Backup generation access

Hello community!!
I am trying to allow a role other than “System Manager” and “Administrator” to generate backups on demand using the button “Download files backup” in /apps/backups page, How to do that??
I edited the bench/apps/frappe/frappe/desk/pages/backups/backups.py line 85 to frappe.only_for("System Manager" , "Role") where Role is a custom role with desk access but it didn’t work!!

Guide plz

Hi @Lola,

Please remove your code from the backups.py file.

First, go to Role Permissions for Pages and Reports. Choose “Set Role forPage and pick the page labeled “backups.” After that, grant access to your custom role and save the changes. Finally, refresh the page (Ctrl + Shift + R) and verify it.

I hope this helps.

Thank You!

Thank you.
I tried that already. After giving access through role permission manager for page and report the role can only access the page but can’t generate backup by clicking Download files backup. A pop up comes “You don’t have enough permission to access this resource. Contact your manager to gain access”…

Guide plz, thank you

Hmm :thinking:,
You’re correct, @Lola.

Kindly modify the code in the ‘backups.py’ file.

frappe.only_for(["System Manager", "Role"])

After that, migrate the site.

I’ve tested the code above, and it worked fine on my end.

I hope this helps.

Thank You!

1 Like

Thank you so much, it worked!!
Even without bench migrate but do I have to run this command or not??

If it works then don’t migrate the site but if not work then you should migrate the site.

About bench migrate, it’s safe if I run it right??

Thank you again for your help. I have added my second topic on discuss.frappe guide me on that too!!

Please check the documentation.

I hope this helps.

Thank You!

1 Like