Only show relevant permissions on the team members page

Since users of broadcast services will always have the view dashboard
permission and never have the API keys permission we can hide these. And
we should re-label the permissions to make sense in the context of
broadcasting.
This commit is contained in:
Chris Hill-Scott
2020-07-13 12:04:11 +01:00
parent 72c1b3d8a1
commit 94434b36e7
2 changed files with 33 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ from app.main.forms import (
PermissionsForm,
SearchUsersForm,
)
from app.models.roles_and_permissions import permissions
from app.models.roles_and_permissions import broadcast_permissions, permissions
from app.models.user import InvitedUser, User
from app.utils import is_gov_user, redact_mobile_number, user_has_permissions
@@ -41,7 +41,9 @@ def manage_users(service_id):
current_user=current_user,
show_search_box=(len(current_service.team_members) > 7),
form=SearchUsersForm(),
permissions=permissions,
permissions=(
broadcast_permissions if current_service.has_permission('broadcast') else permissions
),
)