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

Add per-borough permissions for Django admin #331

Open
5 tasks
cafca opened this issue Apr 21, 2020 · 0 comments
Open
5 tasks

Add per-borough permissions for Django admin #331

cafca opened this issue Apr 21, 2020 · 0 comments
Labels
wontfix This will not be worked on

Comments

@cafca
Copy link
Contributor

cafca commented Apr 21, 2020

What's the problem you want solved?

Users with access to the administration site have access rights to data based on the data kind (i.e. project, report). It is not possible to give them access rights based on the region where an object is situatied (e.g. Friedrichshain-Kreuzberg).

Is there a solution you'd like to recommend?

Add custom permissions for each borough in Berlin and use them to manage access to data in the Django admin.

Tasks

  • Make either the Bezirk or Verantworlich property a field with fixed values in order to be able to use this for assigning permissions
  • Add a custom permission for each Bezirk / Verantworlicher to the Project model. See 1
  • Overwrite the methodsProject.has_view_permission, Project.has_change_permission, Project.has_add_permission and Project.has_delete_permission classes to check whether the current user has the relevant permission for the Project class as a whole and for the specific borough of this project. See 2
  • Add a user group for each permission class
  • Add tests for each combination of permissions
@cafca cafca added the wontfix This will not be worked on label Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant