Skip to content

Commit

Permalink
check that user has a Role attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Pellegrino committed Feb 20, 2014
1 parent e794841 commit bc34240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_prbac/decorators.py
Expand Up @@ -29,7 +29,7 @@ def wrapped(request, *args, **kwargs):
if request.role.has_privilege(privilege):
return fn(request, *args, **kwargs)

if not hasattr(request, 'user'):
if not hasattr(request, 'user') or not hasattr(request.user, 'prbac_role'):
raise PermissionDenied()

try:
Expand Down

0 comments on commit bc34240

Please sign in to comment.