♻️(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.
This commit is contained in:
committed by
Anthony LC
parent
122e510ff4
commit
7bc060988d
@@ -664,7 +664,7 @@ class Document(MP_Node, BaseModel):
|
||||
|
||||
@property
|
||||
def ancestors_link_definition(self):
|
||||
"""Link defintion equivalent to all document's ancestors."""
|
||||
"""Link definition equivalent to all document's ancestors."""
|
||||
if getattr(self, "_ancestors_link_definition", None) is None:
|
||||
if self.depth <= 1:
|
||||
ancestors_links = []
|
||||
|
||||
@@ -74,7 +74,6 @@ def test_api_documents_trashbin_format():
|
||||
"accesses_view": True,
|
||||
"ai_transform": True,
|
||||
"ai_translate": True,
|
||||
"ancestors_links_definitions": {},
|
||||
"attachment_upload": True,
|
||||
"can_edit": True,
|
||||
"children_create": True,
|
||||
|
||||
Reference in New Issue
Block a user