SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 8cb4ba3e authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Permissions update

parent 08473468
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,17 @@ from django.contrib.auth.decorators import user_passes_test
def fellowship_required():
"""Require user to have any Fellowship."""
"""
Require user to have any Fellowship or Administrational permissions.
"""
def test(u):
if u.is_authenticated():
if hasattr(u, 'contributor') and u.contributor.fellowships.exists():
# Fellow
return True
if u.has_perm('scipost.can_view_pool'):
# Administrator
return True
return False
return user_passes_test(test)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment