Merge "Add Project Admin Decorator"

This commit is contained in:
Zuul 2018-01-10 13:59:21 +00:00 committed by Gerrit Code Review
commit 4b52b8ec55
1 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,15 @@ def mod_or_admin(func, *args, **kwargs):
{'project_admin', 'project_mod', 'admin'}, func, *args, **kwargs)
@decorator
def project_admin(func, *args, **kwargs):
"""
endpoints setup with this decorator require the admin/project admin role.
"""
return require_roles(
{'project_admin', 'admin'}, func, *args, **kwargs)
@decorator
def admin(func, *args, **kwargs):
"""