Skip to content

Commit

Permalink
Check correct permission:
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamgilbert committed May 31, 2016
1 parent 458259b commit 9d172f1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ def index(request):
if hasattr(settings, 'ALL_APPROVE'):
if settings.ALL_APPROVE == True:
permissions = Permission.objects.all()
print permissions
for permission in permissions:
print permission.codename
permission = Permission.objects.get(codename='can_approve')
if not request.user.has_perm(permission):
if user.has_perm('server.can_approve') == False
request.user.user_permissions.add(permission)
request.user.save()
##get the number of oustanding requests - approved equals null
Expand Down

0 comments on commit 9d172f1

Please sign in to comment.