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

Rework default permissions #1546

Open
winged opened this issue Jul 12, 2021 · 0 comments
Open

Rework default permissions #1546

winged opened this issue Jul 12, 2021 · 0 comments

Comments

@winged
Copy link
Contributor

winged commented Jul 12, 2021

During discussion of #1510, a discussion came up regarding our default permissions.

Right now, Caluma in it's pristine configuration allows every operation to every user. This is awesome for "playground" installations, where we don't want to stand in the way of people trying out things.

However, when switching to "production mode", the defaults should be "closed-by-default", users should only be able to perform the operations that they're explicitly allowed to.

Thus, we should rework the permissions code as follows: When no permission is given, the has_permission() and has_object_permission() methods shall return False.

I think that the configured default permission,AllowAny, still has it's merits. We can implement it in such a way that it implements a method for every mutation type, returning True for all of them. This way, users can implement their permission classes in two ways:

  • Subclass BasePermission, explicitly allowing only what they need to allow
  • Conciously subclass AllowAny, which implies that anything not specified is explicitly allowed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant