From 22e720a2c47eece08d4e8c5c7d8041feb0fba15d Mon Sep 17 00:00:00 2001 From: meichthys Date: Sun, 14 Sep 2025 03:48:30 +0000 Subject: [PATCH] Add basic roles & permissions --- church/fixtures/module_profile.json | 41 ++++ church/fixtures/role.json | 28 +++ church/fixtures/role_profile.json | 314 ++++++++++++++++++++++++++++ church/hooks.py | 12 ++ 4 files changed, 395 insertions(+) create mode 100644 church/fixtures/module_profile.json create mode 100644 church/fixtures/role.json create mode 100644 church/fixtures/role_profile.json diff --git a/church/fixtures/module_profile.json b/church/fixtures/module_profile.json new file mode 100644 index 0000000..9614605 --- /dev/null +++ b/church/fixtures/module_profile.json @@ -0,0 +1,41 @@ +[ + { + "block_modules": [ + { + "module": "Manufacturing", + "parent": "Church", + "parentfield": "block_modules", + "parenttype": "Module Profile" + }, + { + "module": "Quality Management", + "parent": "Church", + "parentfield": "block_modules", + "parenttype": "Module Profile" + }, + { + "module": "Selling", + "parent": "Church", + "parentfield": "block_modules", + "parenttype": "Module Profile" + }, + { + "module": "EDI", + "parent": "Church", + "parentfield": "block_modules", + "parenttype": "Module Profile" + }, + { + "module": "Stock", + "parent": "Church", + "parentfield": "block_modules", + "parenttype": "Module Profile" + } + ], + "docstatus": 0, + "doctype": "Module Profile", + "modified": "2025-09-13 23:37:23.710971", + "module_profile_name": "Church", + "name": "Church" + } +] \ No newline at end of file diff --git a/church/fixtures/role.json b/church/fixtures/role.json new file mode 100644 index 0000000..c792094 --- /dev/null +++ b/church/fixtures/role.json @@ -0,0 +1,28 @@ +[ + { + "desk_access": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Role", + "home_page": null, + "is_custom": 0, + "modified": "2025-09-13 23:33:03.849902", + "name": "Church User", + "restrict_to_domain": null, + "role_name": "Church User", + "two_factor_auth": 0 + }, + { + "desk_access": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Role", + "home_page": null, + "is_custom": 0, + "modified": "2025-09-13 23:33:13.448691", + "name": "Church Manager", + "restrict_to_domain": null, + "role_name": "Church Manager", + "two_factor_auth": 0 + } +] \ No newline at end of file diff --git a/church/fixtures/role_profile.json b/church/fixtures/role_profile.json new file mode 100644 index 0000000..a9f040c --- /dev/null +++ b/church/fixtures/role_profile.json @@ -0,0 +1,314 @@ +[ + { + "docstatus": 0, + "doctype": "Role Profile", + "modified": "2025-09-13 23:44:46.912938", + "name": "Church Manager", + "role_profile": "Church Manager", + "roles": [ + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Academics User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Accounts Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Accounts User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Agriculture Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Agriculture User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Analytics" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Auditor" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Blogger" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Church Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Church User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Customer" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Dashboard Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Delivery Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Delivery User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Employee" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Fleet Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Fulfillment User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "HR Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "HR User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Inbox User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Item Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Knowledge Base Contributor" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Knowledge Base Editor" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Maintenance Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Maintenance User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Manufacturing Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Manufacturing User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Newsletter Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Prepared Report User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Projects Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Projects User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Purchase Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Purchase Master Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Purchase User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Quality Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Report Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Sales Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Sales Master Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Sales User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Script Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Stock Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Stock User" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Supplier" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Support Team" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "System Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Translator" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Website Manager" + }, + { + "parent": "Church Manager", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Workspace Manager" + } + ] + }, + { + "docstatus": 0, + "doctype": "Role Profile", + "modified": "2025-09-13 23:45:22.082001", + "name": "Church User", + "role_profile": "Church User", + "roles": [ + { + "parent": "Church User", + "parentfield": "roles", + "parenttype": "Role Profile", + "role": "Church User" + } + ] + } +] \ No newline at end of file diff --git a/church/hooks.py b/church/hooks.py index 03be528..a9b8493 100644 --- a/church/hooks.py +++ b/church/hooks.py @@ -119,10 +119,22 @@ fixtures = [ "dt": "Module Onboarding", "filters": [["Name", "like", "church"]], }, + { + "dt": "Module Profile", + "filters": [["Name", "in", ("Church")]], + }, { "dt": "Onboarding Step", "filters": [["Name", "in", ["Church Person"]]], }, + { + "dt": "Role", + "filters": [["Name", "in", ["Church Manager", "Church User"]]], + }, + { + "dt": "Role Profile", + "filters": [["Name", "in", ["Church Manager", "Church User"]]], + }, ] # Apps # ------------------