Note
This is a public alpha release, and therefore features and functionality may change and the software and documentation may contain technical bugs or other issues. If you discover any issues please consider registering a GitHub issue.
profiles.permissions module¶
Mixins for views to require certain permissions or ownership.
-
class
profiles.permissions.HasViewPermissionMixin[source]¶ Bases:
django.contrib.auth.mixins.UserPassesTestMixinMixin to reject users who do not have permission to view this DataSource.
-
class
profiles.permissions.OwnerPermissionMixin[source]¶ Bases:
django.contrib.auth.mixins.PermissionRequiredMixinMixin to require that a user has the relevant global permission and is the owner of the relevant object.
TODO replace this with ‘django-guardian’ once it supports Django 2.1 or use ‘rules’
-
has_permission() → bool[source]¶ Require the the user has the relevant global permission and is the owner of this object.
Returns: Does the user have permission to perform this action?
-
owner_attribute= 'owner'¶
-