21 lines
627 B
Python
21 lines
627 B
Python
|
|
from lib import permissions
|
||
|
|
|
||
|
|
|
||
|
|
class PermissionsAdminMixin:
|
||
|
|
def has_add_permission(self, request, obj=None):
|
||
|
|
"""If a group right is not set :)
|
||
|
|
Allways be able to create a version
|
||
|
|
"""
|
||
|
|
return permissions(obj) if obj else True
|
||
|
|
|
||
|
|
def has_change_permission(self, request, obj=None):
|
||
|
|
"""Versions are immutable """
|
||
|
|
return permissions(obj) if obj else True
|
||
|
|
|
||
|
|
def has_delete_permission(self, request, obj=None):
|
||
|
|
"""Versions are immutable """
|
||
|
|
return permissions(obj) if obj else True
|
||
|
|
|
||
|
|
def has_view_permissions(selfself, request, obj=None):
|
||
|
|
return True
|