Hi,
How to get a custom role to be automatically created and default permission to certain doctype to be set on this role, when I install a custom app to a site?
Can anyone please give me a hint? Thank you in advance.
-Lucky
Hi,
How to get a custom role to be automatically created and default permission to certain doctype to be set on this role, when I install a custom app to a site?
Can anyone please give me a hint? Thank you in advance.
-Lucky
You can export the roles as fixtures in your custom app. Those roles then can be installed automatically after you install your app in frappe.
Thanks, Makarand
you can also filter the roles so that only custom roles will be included in fixtures.
try
fixtures = [{ "doctype": "Role", "filters": { "name": ["in", "Role1,Role2"] }]