Skip to content

Commit 7bc0609

Browse files
sampaccoudAntoLC
authored andcommitted
♻️(backend) simplify roles by returning only the max role
We were returning the list of roles a user has on a document (direct and inherited). Now that we introduced priority on roles, we are able to determine what is the max role and return only this one. This commit also changes the role that is returned for the restricted reach: we now return None because the role is not relevant in this case.
1 parent 122e510 commit 7bc0609

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/backend/core/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ def link_definition(self):
664664

665665
@property
666666
def ancestors_link_definition(self):
667-
"""Link defintion equivalent to all document's ancestors."""
667+
"""Link definition equivalent to all document's ancestors."""
668668
if getattr(self, "_ancestors_link_definition", None) is None:
669669
if self.depth <= 1:
670670
ancestors_links = []

src/backend/core/tests/documents/test_api_documents_trashbin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def test_api_documents_trashbin_format():
7474
"accesses_view": True,
7575
"ai_transform": True,
7676
"ai_translate": True,
77-
"ancestors_links_definitions": {},
7877
"attachment_upload": True,
7978
"can_edit": True,
8079
"children_create": True,

0 commit comments

Comments
 (0)