🛂(back) restrict document's duplicate action to authenticated users

The duplicate was also able for anonynous user if they can read it. We
have to restrict it to at least reader authenticated otherwise no access
will be created on the duplicated document.
This commit is contained in:
Manuel Raynaud
2025-07-02 13:45:50 +02:00
committed by Anthony LC
parent fc1678d0c2
commit e82e6a1fcf
4 changed files with 6 additions and 6 deletions

View File

@@ -842,7 +842,7 @@ class Document(MP_Node, BaseModel):
"cors_proxy": can_get,
"descendants": can_get,
"destroy": is_owner,
"duplicate": can_get,
"duplicate": can_get and user.is_authenticated,
"favorite": can_get and user.is_authenticated,
"link_configuration": is_owner_or_admin,
"invite_owner": is_owner,