How to remove file manager icon

Hello everyone,

Does anyone knows how to remove or hide this (file manager )icon , or restrict user to open it. So that no one can view others or system images.

Thank you

But where?

1 Like

sorry i forgot to attach the snapshot here it is.

Either remove this icon or hide this icon for everyone.

Please help, Thank you

Hi @rs115199789,

If you want to hide or remove something for just one doctype, you can do that. Simply use the client script and test it out.

frappe.ui.form.on('Your DocType', {
    refresh: function(frm) {
        $('button.text-muted.btn.btn-default.icon-btn.explore-btn').remove();
    }
});

Please set the doctype, reload, and check.

Thank You!

Thanks for the reply but the button is still there.

i applied the code as well in the client script.

frappe.ui.form.on(‘File’, {
refresh: function(frm) {
$(‘button.text-muted.btn.btn-default.icon-btn.explore-btn’).remove();
}
});

We need to remove that button so that no one can view others files.

Thank You

Please reload (Ctrl + Shift + R) and check.

Already checked with ctrl+shift+r
even in the different browser.

Thank you

which version and which doctype?

Otherwise add setTimeout and check it.

frappe.ui.form.on('Your DocType', {
    refresh: function(frm) {
        setTimeout(() => {
            $('button.text-muted.btn.btn-default.icon-btn.explore-btn').remove();
        }, 10);
    }
});

I tested in both version 14 and 15. so it’s worked properly.

1 Like

frappe/erpnext:version-14- v14.65.2
doc type file.

i have attached the image as well.
also as you can see it’s not removed do you have any alternate method to remove this icon or restrict users to access to it.

I removed the FILE permission from role permission manager but it’s also not working.

sad

Thanks

Please check the post.

use setTimeout

sorry sir it’s not working :frowning:

Is there anyway to restrict users to open it ?
Like when they try to click on that it will show permission denied something ?

Thank you

Hi @rs115199789,

Please check it.

Thank You!

You are a master.

Thank you so much.

Thanks for the solution.

Do you also know how to restrict everyone to delete any document/attachment.