Repository navigation
feat(permissions): create and clone permission sets from Manage Permissions - #2182
Conversation
…ssions Adds New Permission Set and Clone buttons. Clone copies object, field, tab, setup entity and system permissions from any profile or permission set, including managed ones, and lists anything Salesforce rejects. System permissions are applied last, after the child records exist: many depend on object permissions, and ObjectPermissions cannot be inserted once Modify All Data is on. If the system permission update is rejected, the fields are split in half until only the rejected ones remain. Closes #2053 Closes #1499
There was a problem hiding this comment.
🟢 Ready to approve
No blocking or high-confidence issues found; the create/clone flow handles partial failures and ordering correctly and is covered by unit tests.
Reviewed: f191bdf — 6 files, +1225/-1. Focus: clone sequencing and partial-failure reporting in permission-set-create-utils.ts, modal state and license-default handling in CreatePermissionSetModal.tsx, and selection/refresh wiring in ManagePermissionsSelection.tsx.
Checked and clean: read-before-create ordering (a failed source read never leaves an empty permission set behind), object-permission retry loop, system-permission bisection and its retry pass, per-batch failure isolation, duplicate-error filtering for Task/Event activity fields, API name generation/validation against the shared REGEX constants, created-id selection surviving fetchMetadata(true), effect cleanup/stale-response guards in the modal, and that the batching pattern matches the existing savePermissionRecords.
🤖 Final-gate review via Claude Code /pr-gatekeeper
Adds New Permission Set and Clone buttons to the Manage Permissions selection page.
Implementation notes
ObjectPermissionscan't be inserted once Modify All Data is on. If the single update is rejected, the fields are split in half until only the rejected ones remain.DUPLICATE_VALUEon FieldPermissions is ignored: inserting a shared activity field such asTask.Descriptionalso creates the Event row.Testing
permission-set-create-utils.spec.tscover ordering, retries, duplicate handling, isolating rejected system permissions, and failed batches.Closes #2053
Closes #1499