Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider allowing permission revocation calls for permissions that do not exist #718

Open
rekmarks opened this issue Mar 11, 2022 · 0 comments

Comments

@rekmarks
Copy link
Member

rekmarks commented Mar 11, 2022

revokePermissions, revokeAllPermissions, and related methods / actions of the PermissionController 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 the PermissionController.

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.

@rekmarks rekmarks added the PermissionController Related to the PermissionController. label Mar 11, 2022
@rekmarks rekmarks changed the title Consider allow permission revocation calls for permissions that do not exist Consider allowing permission revocation calls for permissions that do not exist Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants