Skip to content

Commit 4026a1c

Browse files
committed
squash!: Improve namings
1 parent 4b2b47c commit 4026a1c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

openedx_authz/api/users.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050
"get_user_role_assignments",
5151
"get_user_role_assignments_in_scope",
5252
"get_user_role_assignments_for_role_in_scope",
53-
"get_user_role_assignments_for_user_filtered",
5453
"get_user_role_assignments_filtered",
5554
"get_all_user_role_assignments_in_scope",
5655
"get_visible_role_assignments_for_user",
56+
"get_visible_specific_user_role_assignments_for_user",
5757
"is_user_allowed",
5858
"get_scopes_for_user_and_permission",
5959
"get_users_for_role_in_scope",
6060
"unassign_all_roles_from_user",
61-
"get_superadmins",
61+
"get_superadmin_assignments",
6262
]
6363

6464

@@ -176,7 +176,7 @@ def get_user_role_assignments_for_role_in_scope(
176176
)
177177

178178

179-
def get_user_role_assignments_for_user_filtered(
179+
def get_visible_specific_user_role_assignments_for_user(
180180
user_external_key: str,
181181
orgs: list[str] = None,
182182
roles: list[str] = None,
@@ -385,7 +385,7 @@ def unassign_all_roles_from_user(user_external_key: str) -> bool:
385385
return unassign_subject_from_all_roles(UserData(external_key=user_external_key))
386386

387387

388-
def get_superadmins(user_external_keys: list[str] | None = None) -> list[SuperAdminAssignmentData]:
388+
def get_superadmin_assignments(user_external_keys: list[str] | None = None) -> list[SuperAdminAssignmentData]:
389389
"""Returns all superadmins as SuperAdminAssignmentData.
390390
391391
A superadmin is a User with a Django staff or superuser role.

openedx_authz/rest_api/v1/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from openedx_authz import api
2323
from openedx_authz.api.data import RoleAssignmentData, SuperAdminAssignmentData
24-
from openedx_authz.api.users import get_superadmins, get_user_role_assignments_for_user_filtered
24+
from openedx_authz.api.users import get_superadmin_assignments, get_visible_specific_user_role_assignments_for_user
2525
from openedx_authz.api.utils import get_user_map
2626
from openedx_authz.constants import permissions
2727
from openedx_authz.rest_api.data import RoleOperationError, RoleOperationStatus
@@ -633,9 +633,9 @@ def get(self, request: HttpRequest, username: str) -> Response:
633633
user_role_assignments: list[RoleAssignmentData | SuperAdminAssignmentData] = []
634634

635635
# Retrieve superadmin assignments (django staff or superuser users), as they always have access to everything
636-
user_role_assignments += get_superadmins(user_external_keys=[username])
636+
user_role_assignments += get_superadmin_assignments(user_external_keys=[username])
637637

638-
user_role_assignments += get_user_role_assignments_for_user_filtered(
638+
user_role_assignments += get_visible_specific_user_role_assignments_for_user(
639639
user_external_key=username,
640640
orgs=query_params.get("orgs"),
641641
roles=query_params.get("roles"),

0 commit comments

Comments
 (0)