@@ -355,31 +355,37 @@ def validate_external_key(cls, _: str) -> bool:
355355
356356 @classmethod
357357 @abstractmethod
358- def get_admin_view_permission (cls ) -> PermissionData :
359- """Get the permission required to view this scope
358+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
359+ """Get the permissions required to view this scope.
360360
361361 This method should be implemented on every ScopeData subclass to define
362- which permission to check against when a user tries to see assignations
362+ which permissions to check against when a user tries to see assignations
363363 related to this scope in the Admin Console.
364364
365+ The consumer uses OR logic: if the user has any one of the returned
366+ permissions, access is granted. An empty list means access is denied.
367+
365368 Returns:
366- PermissionData: The permission required to view this scope in the admin console.
369+ list[ PermissionData] : The permissions required to view this scope in the admin console.
367370 """
368- raise NotImplementedError ("Subclasses must implement get_admin_view_permission method." )
371+ raise NotImplementedError ("Subclasses must implement get_admin_view_permissions method." )
369372
370373 @classmethod
371374 @abstractmethod
372- def get_admin_manage_permission (cls ) -> PermissionData :
373- """Get the permission required to manage this scope
375+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
376+ """Get the permissions required to manage this scope.
374377
375378 This method should be implemented on every ScopeData subclass to define
376- which permission to check against when a user tries to manage assignations
379+ which permissions to check against when a user tries to manage assignations
377380 related to this scope in the Admin Console.
378381
382+ The consumer uses OR logic: if the user has any one of the returned
383+ permissions, access is granted. An empty list means access is denied.
384+
379385 Returns:
380- PermissionData: The permission required to manage this scope in the admin console.
386+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
381387 """
382- raise NotImplementedError ("Subclasses must implement get_admin_manage_permission method." )
388+ raise NotImplementedError ("Subclasses must implement get_admin_manage_permissions method." )
383389
384390 @abstractmethod
385391 def get_object (self ) -> Any | None :
@@ -452,28 +458,28 @@ def validate_external_key(cls, external_key: str) -> bool:
452458 return external_key == GLOBAL_SCOPE_WILDCARD
453459
454460 @classmethod
455- def get_admin_view_permission (cls ) -> PermissionData :
456- """No admin view permission for the global scope.
461+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
462+ """Get the permissions required to view the global scope.
457463
458- Global scope assignments are managed exclusively by superadmins
459- at the REST API layer, so no granular permission is needed .
464+ Since the global scope spans all resource types, a user needs any one
465+ of the scope-specific view permissions to be granted access .
460466
461467 Returns:
462- None
468+ list[PermissionData]: VIEW_LIBRARY_TEAM or COURSES_VIEW_COURSE_TEAM (OR logic).
463469 """
464- return VIEW_LIBRARY_TEAM
470+ return [ VIEW_LIBRARY_TEAM , COURSES_VIEW_COURSE_TEAM ]
465471
466472 @classmethod
467- def get_admin_manage_permission (cls ) -> PermissionData :
468- """No admin manage permission for the global scope.
473+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
474+ """No manage permissions for the global scope.
469475
470- Global scope assignments are managed exclusively by superadmins
471- at the REST API layer, so no granular permission is needed .
476+ Global scope management is restricted to superadmins at the REST API
477+ layer, so no granular permission grants access .
472478
473479 Returns:
474- None
480+ list[PermissionData]: Empty list — access is always denied via permissions.
475481 """
476- return None
482+ return []
477483
478484 def get_object (self ) -> None :
479485 """The global wildcard scope does not map to a concrete domain object.
@@ -566,22 +572,22 @@ def validate_external_key(cls, external_key: str) -> bool:
566572 return False
567573
568574 @classmethod
569- def get_admin_view_permission (cls ) -> PermissionData :
570- """Get the permission required to view this scope
575+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
576+ """Get the permissions required to view this scope.
571577
572578 Returns:
573- PermissionData: The permission required to view this scope in the admin console.
579+ list[ PermissionData] : The permissions required to view this scope in the admin console.
574580 """
575- return VIEW_LIBRARY_TEAM
581+ return [ VIEW_LIBRARY_TEAM ]
576582
577583 @classmethod
578- def get_admin_manage_permission (cls ) -> PermissionData :
579- """Get the permission required to manage this scope
584+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
585+ """Get the permissions required to manage this scope.
580586
581587 Returns:
582- PermissionData: The permission required to manage this scope in the admin console.
588+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
583589 """
584- return MANAGE_LIBRARY_TEAM
590+ return [ MANAGE_LIBRARY_TEAM ]
585591
586592 def get_object (self ) -> ContentLibrary | None :
587593 """Retrieve the ContentLibrary instance associated with this scope.
@@ -697,22 +703,22 @@ def validate_external_key(cls, external_key: str) -> bool:
697703 return False
698704
699705 @classmethod
700- def get_admin_view_permission (cls ) -> PermissionData :
701- """Get the permission required to view this scope
706+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
707+ """Get the permissions required to view this scope.
702708
703709 Returns:
704- PermissionData: The permission required to view this scope in the admin console.
710+ list[ PermissionData] : The permissions required to view this scope in the admin console.
705711 """
706- return COURSES_VIEW_COURSE_TEAM
712+ return [ COURSES_VIEW_COURSE_TEAM ]
707713
708714 @classmethod
709- def get_admin_manage_permission (cls ) -> PermissionData :
710- """Get the permission required to manage this scope
715+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
716+ """Get the permissions required to manage this scope.
711717
712718 Returns:
713- PermissionData: The permission required to manage this scope in the admin console.
719+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
714720 """
715- return COURSES_MANAGE_COURSE_TEAM
721+ return [ COURSES_MANAGE_COURSE_TEAM ]
716722
717723 def get_object (self ) -> CourseOverview | None :
718724 """Retrieve the CourseOverview instance associated with this scope.
@@ -821,13 +827,13 @@ def validate_external_key(cls, external_key: str) -> bool:
821827 return True
822828
823829 @classmethod
824- def get_admin_view_permission (cls ) -> PermissionData :
825- """Get the permission required to view this scope
830+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
831+ """Get the permissions required to view this scope.
826832
827833 Returns:
828- PermissionData: The permission required to view this scope in the admin console.
834+ list[ PermissionData] : The permissions required to view this scope in the admin console.
829835 """
830- raise NotImplementedError ("Subclasses must implement get_admin_view_permission method." )
836+ raise NotImplementedError ("Subclasses must implement get_admin_view_permissions method." )
831837
832838 @classmethod
833839 def build_external_key (cls , org : str ) -> str :
@@ -848,13 +854,13 @@ def build_external_key(cls, org: str) -> str:
848854 return f"{ cls .NAMESPACE } { EXTERNAL_KEY_SEPARATOR } { org } { cls .ID_SEPARATOR } { GLOBAL_SCOPE_WILDCARD } "
849855
850856 @classmethod
851- def get_admin_manage_permission (cls ) -> PermissionData :
852- """Get the permission required to manage this scope
857+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
858+ """Get the permissions required to manage this scope.
853859
854860 Returns:
855- PermissionData: The permission required to manage this scope in the admin console.
861+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
856862 """
857- raise NotImplementedError ("Subclasses must implement get_admin_manage_permission method." )
863+ raise NotImplementedError ("Subclasses must implement get_admin_manage_permissions method." )
858864
859865 @classmethod
860866 def get_org (cls , external_key : str ) -> str | None :
@@ -946,22 +952,22 @@ class OrgContentLibraryGlobData(OrgGlobData):
946952 ID_SEPARATOR : ClassVar [str ] = ":"
947953
948954 @classmethod
949- def get_admin_view_permission (cls ) -> PermissionData :
950- """Get the permission required to view this scope
955+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
956+ """Get the permissions required to view this scope.
951957
952958 Returns:
953- PermissionData: The permission required to view this scope in the admin console.
959+ list[ PermissionData] : The permissions required to view this scope in the admin console.
954960 """
955- return VIEW_LIBRARY_TEAM
961+ return [ VIEW_LIBRARY_TEAM ]
956962
957963 @classmethod
958- def get_admin_manage_permission (cls ) -> PermissionData :
959- """Get the permission required to manage this scope
964+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
965+ """Get the permissions required to manage this scope.
960966
961967 Returns:
962- PermissionData: The permission required to manage this scope in the admin console.
968+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
963969 """
964- return MANAGE_LIBRARY_TEAM
970+ return [ MANAGE_LIBRARY_TEAM ]
965971
966972
967973@define
@@ -1004,22 +1010,22 @@ class OrgCourseOverviewGlobData(OrgGlobData):
10041010 ID_SEPARATOR : ClassVar [str ] = "+"
10051011
10061012 @classmethod
1007- def get_admin_view_permission (cls ) -> PermissionData :
1008- """Get the permission required to view this scope
1013+ def get_admin_view_permissions (cls ) -> list [ PermissionData ] :
1014+ """Get the permissions required to view this scope.
10091015
10101016 Returns:
1011- PermissionData: The permission required to view this scope in the admin console.
1017+ list[ PermissionData] : The permissions required to view this scope in the admin console.
10121018 """
1013- return COURSES_VIEW_COURSE_TEAM
1019+ return [ COURSES_VIEW_COURSE_TEAM ]
10141020
10151021 @classmethod
1016- def get_admin_manage_permission (cls ) -> PermissionData :
1017- """Get the permission required to manage this scope
1022+ def get_admin_manage_permissions (cls ) -> list [ PermissionData ] :
1023+ """Get the permissions required to manage this scope.
10181024
10191025 Returns:
1020- PermissionData: The permission required to manage this scope in the admin console.
1026+ list[ PermissionData] : The permissions required to manage this scope in the admin console.
10211027 """
1022- return COURSES_MANAGE_COURSE_TEAM
1028+ return [ COURSES_MANAGE_COURSE_TEAM ]
10231029
10241030
10251031class CCXCourseOverviewData (CourseOverviewData ):
0 commit comments