Skip to content

Commit

Permalink
docs: show example ACL
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo committed Nov 19, 2016
1 parent f68aba9 commit 9e6ea69
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,19 @@ inside your models file, to extend your existing models (if following the basic
class Resource(ResourceMixin, Base):
# ... your own properties....
pass
# example implementation of ACLS for pyramid application
@property
def __acl__(self):
acls = []
if self.owner_user_id:
acls.extend([(Allow, self.owner_user_id, ALL_PERMISSIONS,), ])
if self.owner_group_id:
acls.extend([(Allow, "group:%s" % self.owner_group_id,
ALL_PERMISSIONS,), ])
return acls
class UserPermission(UserPermissionMixin, Base):
pass
Expand Down

0 comments on commit 9e6ea69

Please sign in to comment.