Add RBAC permission scripts (roles, field-levels, scoping, cleanup) - #9
Open
hamad-clustox wants to merge 4 commits into
Open
hamad-clustox wants to merge 4 commits into
hamad-clustox wants to merge 4 commits into
Conversation
Repeatable, idempotent setup/permissions/ scripts that build the whole permission model on a Frappe HR site: - apply_rights_matrix.py + rights_matrix.json — 5 roles (Team Lead, Department Head, CEO/COO, IT User, Admin User) and the 38-DocType rights matrix from HR's permission sheet - apply_field_levels.py — sensitive Employee fields to Permission Level 1 (DOB/CNIC/contact) and 2 (bank), granted only to HR/CEO/Accounts - scope_employees.py — User Permissions restricting employees to their own transactional records; directory/org chart stay visible - assign_roles.py — role assignment from a private JSON mapping (no PII in repo; see role_assignments.example.json) - set_reports_to.py — org-chart reporting placeholder - disable_roles.py — declutter unused ERPNext business-module roles No secrets or employee PII are committed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Routes plus-addressed support email to the right HD Team so the existing per-team round-robin assigns an agent: support+it@ -> IT Team support+accounts@ -> Accounts Team support+admin@ -> Admin Team - hrms/helpdesk_router.py: route_tickets() reads the recipient tag from the incoming email's Communication and sets the ticket's agent_group. No-op where Helpdesk isn't installed. - hooks.py: registered under scheduler_events['all'] so bench migrate wires it up and the scheduler runs it (server-script Scheduler Events don't register on this build). Runs OUTSIDE the email-receive transaction on purpose — routing from a Communication doc-event breaks all inbound email. - setup/helpdesk/README.md: routing, registration, and the SLA/FRT + Jira-loop findings from the IT review. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two signature-verified endpoints (hrms/slack_helpdesk.py):
slack_command -> opens a modal (subject, description, team, priority)
slack_interact -> creates the HD Ticket on the chosen team; the existing
round-robin assigns an agent; DMs the reporter the number
Secrets (slack_signing_secret, slack_bot_token) live in site config, not code.
Setup guide: setup/helpdesk/SLACK_SETUP.md. MVP — pending live Slack test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add Helpdesk email-tag team routing (scheduled job)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #8 (adds
setup/permissions/, which builds on thesetup/folder introduced there). Base retargets todeveloponce #8 merges.What this adds
Repeatable, idempotent scripts that reproduce the entire permission model on a fresh Frappe HR site. Each is a Frappe script run via
bench execute hrms.<module>.run; seesetup/permissions/README.mdfor run order.apply_rights_matrix.py+rights_matrix.jsonapply_field_levels.pyscope_employees.pyassign_roles.pyrole_assignments.example.json).set_reports_to.pyreports_toso the org chart renders (placeholder for real lines).disable_roles.pySafety / privacy
role_assignments.example.json(placeholder codes) ships.bench migraterecreation trap).Not included (documented as follow-ups in the README)
🤖 Generated with Claude Code