Skip to content

fix(install): preserve role perms when adding Custom DocPerm#2

Merged
dpk404 merged 1 commit into
mainfrom
develop
Jun 1, 2026
Merged

fix(install): preserve role perms when adding Custom DocPerm#2
dpk404 merged 1 commit into
mainfrom
develop

Conversation

@dpk404

@dpk404 dpk404 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Inserting any Custom DocPerm row flips Frappe's permission engine to treat Custom DocPerm as the full source-of-truth for that doctype, dropping every standard DocPerm row.
  • The installer was wiping CRM Lead access for every role except "Gravity Form" because it added a Custom DocPerm row without first cloning the standard rows into Custom DocPerm.
  • Fix: call frappe.permissions.setup_custom_perms(doctype) before inserting the new row, so the standard rows are mirrored and preserved.

Inserting any Custom DocPerm row makes Frappe drop ALL standard DocPerms
for the doctype (see frappe.permissions.get_valid_perms), wiping CRM Lead
access for every role except Gravity Form. Call setup_custom_perms first
so the standard rows are cloned into Custom DocPerm and preserved.
@dpk404 dpk404 merged commit d78fb10 into main Jun 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant