How to setup User permission for a particular File folder

Hello Everyone,

I have created a role called “File Manager”, and have assigned this role to 5 users with permissions.

I have created a folder in File Doctype as “Sales Documents”.

As seen in the above image, there is also a folder called “Attachments”.

Can anyone help me on how to give access to 5 users only for the Sales Documents Folder.

I had tried with User Permission setup, but still this doesn’t seems to work.

We are using,

ERPNext: v11.1.39 (master)

Frappe Framework: v11.1.36 (master)

Thanks & Regards,
Sujay

You can use permission query for that.

@Tripti.Sharma

Could you please elaborate this.

in hooks.py:

permission_query_conditions = {
“Doctype Name”: “path.to.py.file”,
}

in .py file:
@frappe.whitelist()
def get_permission_query_conditions(user):
if not user:
user = frappe.session.user
if “System Manager” in frappe.get_roles(user):
return None
elif “role” in frappe.get_roles(user):
l = (“”" ‘tabTable Name’.owner= ‘%s’ “”" % (user))
return l

Hello.
No we have only this way or maybe developers do something new in User Permissions?
If not can you give more information where should I insert your code? I am newby in that, hope for understanding.