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

@@ -1,6 +1,6 @@
from app.notify_client import NotifyAdminAPIClient, _attach_current_user, cache
from app.utils.user_permissions import (
roles,
all_ui_permissions,
translate_permissions_from_admin_roles_to_db,
)
@@ -48,7 +48,7 @@ class InviteApiClient(NotifyAdminAPIClient):
)['data']
def get_count_of_invites_with_permission(self, service_id, permission):
if permission not in roles.keys():
if permission not in all_ui_permissions:
raise TypeError('{} is not a valid permission'.format(permission))
return len([
invited_user for invited_user in self.get_invites_for_service(service_id)