✨(backend) add max ancestors role field to document access endpoint
This field is set only on the list view when all accesses for a given document and all its ancestors are listed. It gives the highest role among all accesses related to each document.
This commit is contained in:
committed by
Anthony LC
parent
f782a0236b
commit
1ab237af3b
@@ -1140,7 +1140,9 @@ class DocumentAccess(BaseAccess):
|
||||
set_role_to.append(RoleChoices.OWNER)
|
||||
|
||||
# Filter out roles that would be lower than the one the user already has
|
||||
ancestors_role_priority = RoleChoices.get_priority(ancestors_role)
|
||||
ancestors_role_priority = RoleChoices.get_priority(
|
||||
getattr(self, "max_ancestors_role", None)
|
||||
)
|
||||
set_role_to = [
|
||||
candidate_role
|
||||
for candidate_role in set_role_to
|
||||
|
||||
Reference in New Issue
Block a user