user_acl_middlewaremiddleware to set
user_aclproperty on the
user_aclproperty is plain dictionary that contains user acl as well as additional data useful for permission checks:
user_id- ID of the user this
cache_versions- copy of cache versions used to create this
user_acloutside of http request, you will need to use
misago.cache.versionsto obtain cache versions:
categoriesentry is dict of dicts:
add_acl_to_objutility function from
misago.acl.objectacl. Doing so will create an
aclproperty on the object for you to instrospect its permissions easily:
Misago User ACLoption to the Django Debug Toolbar menu. This page display user roles permissions as well as final ACL assigned to current request.
MISAGO_ACL_EXTENSIONSsetting. By convention, those modules are either named "permissions", or they are located in "permissions" package.
YesNoSwitchform field that renders nice "Yes/No" switch as input. This field is simple wrapper around
TypedChoiceFieldthat coerces to
int. If you use use it for your permissions, make sure your ACL implementation handles their values as
0, not as
False, or your forms will break!
build_acl(acl, roles, key_name)
permissionsattributes. Its expected to access roles
permissionsattributes which are dicts of values coming from permission change forms and return updated
registry- istance of PermissionProviders that imported module.
register_withfunction is called, its passed
PermissionProvidersinstance that exposes following methods:
funcas ACL annotator for
funcas user ACL serializer. This function will be called with copy of
cache_versionskey), and is expected to perform any required changes before ACL will be converted to JSON and sent to client. For example, an serializer simplifies the
categoriesentry to only contain ACL for categories that are browseable by the user.
objor empty list is none exist.
user- user asking to make target aware of its ACL's
target- target instance, guaranteed to be an single object, not list or other iterable (like queryset)
sum_acls(result_acl, acls=None, roles=None, key=None, **permissions)
sum_aclssupport for new tests specific for your ACLs.