We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae87974 commit a7c9492Copy full SHA for a7c9492
common/djangoapps/student/roles.py
@@ -532,9 +532,10 @@ def _authz_get_orgs_for_user(self, user) -> list[str]:
532
Returns a list of org short names for the user with given role.
533
AuthZ compatibility layer
534
"""
535
- # TODO: This will be implemented on Milestone 1
536
- # of the Authz for Course Authoring project
537
- return []
+ role = get_authz_role_from_legacy_role(self._role_name)
+ assignments = authz_api.get_user_role_assignments_for_role(user.username, role)
+ orgs = {assignment.scope.org for assignment in assignments if assignment.scope.org is not None}
538
+ return list(orgs)
539
540
def _legacy_get_orgs_for_user(self, user) -> list[str]:
541
0 commit comments