Skip to content

Instantly share code, notes, and snippets.

@iivvoo
Created April 28, 2014 10:29
Show Gist options
  • Save iivvoo/11367932 to your computer and use it in GitHub Desktop.
Save iivvoo/11367932 to your computer and use it in GitHub Desktop.
from wheelcms_axle.auth import lr, local_roles
from quanza_ci.organization import OrganizationType, Membership
from quanza_ci.roles import employee
def org_lr(obj, request=None):
if Membership.objects.filter(user=request.user, organization=obj.instance).exists():
return [employee]
return []
lr.register(local_roles, [OrganizationType], org_lr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment