How to restrict view of attached file role wise in left side panel

Hello everyone,
If file is attached via doctype attach file it is getting displayed in left side of the form due to that every user can view the attached file. Even field level permission is applied for that particular field of that doctype that field is not getting displayed for view but in left side of the form attachment + icon there files are getting displayed if user click on to that it is getting viewed.
Can any one suggest how to restrict this view for user role wise.

Regards
Nivedha

1 Like

Hi @Nivedha,

Please check the post.

Also apply the user condition like:

if (frappe.session.user == "user1@test-mail.com") {
// your code
}

I think, only have the above option.

Thank You!