Start to remove use of the term "roles"

We don't use this term consistently and it's not defined anywhere.
Since most of the Admin app deals with user-facing permssions, it's
OK to just use the term "permissions". Where both types of permission
are present in the same file, we can more clearly distinguish them
as "UI permissions" and "DB permissions".
This commit is contained in:
Ben Thorner
2021-07-22 14:25:22 +01:00
parent a38baa0bd8
commit ba9865e62e
4 changed files with 12 additions and 12 deletions

View File

@@ -59,9 +59,9 @@ from app.models.organisation import Organisation
from app.utils import merge_jsonlike
from app.utils.user import distinct_email_addresses
from app.utils.user_permissions import (
all_ui_permissions,
broadcast_permission_options,
permission_options,
roles,
)
@@ -1006,7 +1006,7 @@ class BasePermissionsForm(StripWhitespaceForm):
**kwargs,
**{
"permissions_field": [
role for role in roles.keys() if user.has_permission_for_service(service_id, role)]
role for role in all_ui_permissions if user.has_permission_for_service(service_id, role)]
},
login_authentication=user.auth_type
)