fix: validate ptype in file has_permission
This commit is contained in:
parent
a2fdff9006
commit
e15d4c837a
1 changed files with 4 additions and 2 deletions
|
|
@ -887,8 +887,10 @@ def has_permission(doc, ptype=None, user=None, debug=False):
|
|||
return True
|
||||
if (
|
||||
user != "Guest"
|
||||
and ptype
|
||||
and frappe.share.get_shared("File", filters=[["share_name", "=", doc.name]], rights=[ptype], user=user)
|
||||
and ptype in ["read", "write", "share", "submit"]
|
||||
and frappe.share.get_shared(
|
||||
"File", filters=[["share_name", "=", doc.name]], rights=[ptype], user=user
|
||||
)
|
||||
):
|
||||
return True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue