File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 "RoleData" ,
1818 "ScopeData" ,
1919 "SubjectData" ,
20+ "ContentLibraryData" ,
2021]
2122
2223AUTHZ_POLICY_ATTRIBUTES_SEPARATOR = "^"
@@ -556,6 +557,15 @@ class PermissionData:
556557 action : ActionData = None
557558 effect : Literal ["allow" , "deny" ] = "allow"
558559
560+ @property
561+ def identifier (self ) -> str :
562+ """Get the permission identifier.
563+
564+ Returns:
565+ str: The permission identifier (e.g., 'delete_library').
566+ """
567+ return self .action .external_key
568+
559569 def __str__ (self ):
560570 """Human readable string representation of the permission and its effect."""
561571 return f"{ self .action } - { self .effect } "
@@ -606,6 +616,14 @@ def name(self) -> str:
606616 """
607617 return self .external_key .replace ("_" , " " ).title ()
608618
619+ def get_permission_identifiers (self ) -> list [str ]:
620+ """Get the technical identifiers for all permissions in this role.
621+
622+ Returns:
623+ list[str]: Permission identifiers (e.g., ['delete_library', 'edit_content']).
624+ """
625+ return [permission .identifier for permission in self .permissions ]
626+
609627 def __str__ (self ):
610628 """Human readable string representation of the role and its permissions."""
611629 return f"{ self .name } : { ', ' .join (str (p ) for p in self .permissions )} "
You can’t perform that action at this time.
0 commit comments