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 #35

Open
l0rb opened this issue Dec 6, 2019 · 0 comments
Open

Permissions #35

l0rb opened this issue Dec 6, 2019 · 0 comments

Comments

@l0rb
Copy link
Collaborator

l0rb commented Dec 6, 2019

Django has a nice built-in permission system: https://docs.djangoproject.com/en/3.0/topics/auth/default/#permissions-and-authorization

Permissions can be given to users via the builtin admin-site. It does not out-of-the box support instance level permissions which will be needed for issue #14 . It does however provide hooks for that.

Permissions can be set not only per type of object, but also per specific object instance. By using the has_view_permission(), has_add_permission(), has_change_permission() and has_delete_permission() methods provided by the ModelAdmin class, it is possible to customize permissions for different object instances of the same type.

It is probably best to have a many-to-many relationship between corpora and users where the pivot table holds information about what permissions the user has specifically for that corpus and than check the values of that pivot table in the methods mentioned above.

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