mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-15 09:34:25 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user