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

Permissions in /api compared to /admin #135

Open
bryan-brancotte opened this issue Dec 9, 2020 · 2 comments
Open

Permissions in /api compared to /admin #135

bryan-brancotte opened this issue Dec 9, 2020 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@bryan-brancotte
Copy link
Member

bryan-brancotte commented Dec 9, 2020

Hi !

I need your opinion on this @hmenager @thomasrosnet

When a user wants to edit an object trough /api, we use the permissions specified in the class to test whether the user can or cannot edit the object. When the same user wants to do it through /admin we also check if the user is granted on the model by django permissions.

This means :

  • a user can have more rights in /api than in /admin.
  • a user that have just created an account can create a team without needing to wait for an admin to grant him/her the permission

We thus have to chose between :

  • strictly the same rights between /api /admin and user who cannot create new objects unless an admin allows it
  • /api does not use model permission, user can directly add new objects, but have to be granted to do it in the admin interface
  • not use model permission at all, juste permissions we create in permissions.py (PubliclyReadableEditableByLeader, ...) and thus have strictly the same rights between /api /admin
@bryan-brancotte bryan-brancotte added the question Further information is requested label Dec 9, 2020
@bryan-brancotte bryan-brancotte self-assigned this Dec 9, 2020
@bryan-brancotte
Copy link
Member Author

...and my opinion on this matter is that we should allows all admins to edit in /admin everything they already can in /api

@bryan-brancotte
Copy link
Member Author

The patch doing the first very strict option
git apply /tmp/patch.txt
patch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant