Ticket #27528: auth.py

File auth.py, 345 bytes (added by Jamie Bliss, 8 years ago)

Snippet implementing basic object-level permissions.

Line 
1class UseGeneralPermissions:
2 """
3 Permissions provider that does object-level permissions by using general permissions.
4 """
5 def has_perm(self, user_obj, perm, obj=None):
6 if obj is None:
7 return False
8 else:
9 # Retry using general permissions
10 return user_obj.has_perm(perm)
Back to Top