Export Role Permissions Manager settings

Hi

I’ve an app in my local setup where I’ve configured some permissions for different roles in the Role Permissions Manager. Is it possible to export it in a fixture (JSON) like format and apply these changes to the production site?
Since there are a lot of roles/permissions, I’m looking for a solution to export/import these permissions rather than manually creating and maintaining them on the server & development setup.

Thanks

3 Likes

You can export the table Custom DocPerm

7 Likes

I’ve generated a fixture but all the records have "user_permission_doctypes": null and when I migrated this on the server I couldn’t see for which doctype the permissions are applied. Thus, effectively it didn’t help.

Is this a bug or am I missing something?

Thanks

5 Likes

I have a hard time understanding this. What is the right way to export permissions from one site to another? I understand you can export fixtures on the table Custom DocPerm but how are these permissions connected to a doctype since there is no link between the permissions and doctypes?

Hi, i have de the same question.

Regards

Noticed the same thing. Did you get a solution?

fixtures = [{
“doctype”: “Role”,
“filters”: {
“name”: [“in”, “Item Manager Sabila”]
},
“doctype”: “Custom DocPerm”,
“filters”: {
“role”: [“in”,“Item Manager Sabila”]
}
}]

2 Likes

Superceded in v13:

hello sir @landaverdelbo
how to add on fixtures

1 Like

bench export-fixtures --app myapp

the output says the doctype that will be exported…

Even after doing this, its not exporting except system manager in production site from local.

You can export the table Custom DocPerm
I don’t think that above solution is a quite solution to that @rmehta

I was wondering if somebody experienced explain how we could export the custom roles permissions to our custom app so we could use it on other ERPNext instances. I am able to export all customizations that i do on doctypes via property setters fixture but for the role and permissions i dont know what is the best way

fixtures = [
{“dt”: “Property Setter”, “filters”: [[“module”, “=”, “mycustomapp”]]}
]

the below is the solution,

i am sharing this so others can benefit from, note that the General Manger is the role that i have created on my dev instance

fixtures = [

{“dt”: “Property Setter”, “filters”: [[“module”, “=”, “mycustomapp”]]}
 
{"dt": "Custom DocPerm", "filters": [["role", "=", "General Manager"]]},

{"dt": "Role", "filters": [["name", "=", "General Manager"]]},

]

1 Like

Thanks for the clarity @Rebaz_Balisani !

1 Like