A platform admin user is able to see a list of all services.

Each service on the list is linked to the dashboard page of the service.
The platform admin user can see/edit templates, see/invite users, see/edit service settings.
The platform admin user can not send messages, see/edit api keys and developer docs.
This commit is contained in:
Rebecca Law
2016-03-17 10:46:47 +00:00
parent cc15d92aaa
commit b28fbc16d7
22 changed files with 154 additions and 104 deletions

View File

@@ -30,12 +30,14 @@ class BrowsableItem(object):
pass
def user_has_permissions(*permissions, or_=False):
def user_has_permissions(*permissions, admin_override=False, or_=False):
def wrap(func):
@wraps(func)
def wrap_func(*args, **kwargs):
from flask_login import current_user
if current_user and current_user.has_permissions(permissions, or_=or_):
if current_user and admin_override and current_user.platform_admin:
return func(*args, **kwargs)
if current_user and current_user.has_permissions(permissions, admin_override=admin_override, or_=or_):
return func(*args, **kwargs)
else:
abort(403)