Skip to content

Commit aa5374b

Browse files
docs: update docstrings
1 parent a33b392 commit aa5374b

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

openedx_authz/api/data.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,8 @@ def identifier(self) -> str:
659659
def __eq__(self, other: "PermissionData") -> bool:
660660
"""Compare permissions based on their action identifier.
661661
662-
Two permissions are considered equal if they have the same action,
663-
regardless of the effect. This allows checking if a role grants a
664-
specific action using the 'in' operator.
662+
Two PermissionData instances are considered equal if they have the same action's
663+
external_key and effect.
665664
666665
Args:
667666
other: Another PermissionData instance or any object.
@@ -671,8 +670,8 @@ def __eq__(self, other: "PermissionData") -> bool:
671670
672671
Example:
673672
>>> perm1 = PermissionData(action=ActionData(external_key='view'), effect='allow')
674-
>>> perm2 = PermissionData(action=ActionData(external_key='view'), effect='deny')
675-
>>> perm1 == perm2 # True - same action TODO: should we also consider the effect?
673+
>>> perm2 = PermissionData(action=ActionData(external_key='view'), effect='allow')
674+
>>> perm1 == perm2 # True - same action and effect
676675
True
677676
>>> perm1 in [perm2] # Uses __eq__
678677
True

0 commit comments

Comments
 (0)