Consider allowing permission revocation calls for permissions that do not exist #718
Labels
PermissionController
Related to the PermissionController.
team-wallet-api-platform
team-wallet-framework
revokePermissions
,revokeAllPermissions
, and related methods / actions of thePermissionController
throw if the user is trying to revoke a permission that does not exist (which is either because a particular subject does not exist or because it doesn't have a particular permission). This was done in accordance with the design principle of "don't permit asking the impossible"; as a rule, it's important that an API is predictable and logically consistent, and that's doubly true if the API is sensitive, as is the case with thePermissionController
.Unfortunately, this design choice is causing downstream inconveniences, since callers always have to check if permissions exist before revoking them, even if the caller doesn't care if they ever existed in the first place. Therefore, it might make sense to modify the revocation methods such that the user can signal whether they care if a revoked permission actually exists or not.
The text was updated successfully, but these errors were encountered: