service-omni-supervisor-permset-assign
Original:🇺🇸 English
Translated
1 scripts
Use to assign the Salesforce-shipped standard ContactCenterSupervisor PermissionSet (default) to N existing supervisor users via PermissionSetAssignment DML. Idempotent — SOQL detects existing (user, perm-set) pairs before POST, and DUPLICATE_VALUE is treated as reused. The standard set carries its own permission-set license and assigns cleanly on Service-Cloud-enabled orgs; a user whose license lacks the entitlement surfaces FIELD_INTEGRITY_EXCEPTION so the operator can fix the profile/license. Triggers: assign the supervisor permset, grant supervisor perms, complete supervisor provisioning. Do not use on production orgs or to assign agent permsets.
3installs
Sourceforcedotcom/sf-skills
Added on
NPX Install
npx skill4agent add forcedotcom/sf-skills service-omni-supervisor-permset-assignTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →service-omni-supervisor-permset-assign
Assign the Salesforce-shipped standard PermissionSet to existing supervisor users via . The classic Omni-Channel Supervisor UI (Command Center) requires supervisors to hold contact-center supervisor permissions before can bind them. The skill uses detect-before-POST idempotency and treats as an already-satisfied assignment.
ContactCenterSupervisorPermissionSetAssignmentservice-omni-supervisor-config-deployDUPLICATE_VALUELicensing. The supervisor system permissions (, , ) are gated by a permission-set license. The standard set carries its own license linkage and assigns cleanly on a Service-Cloud-enabled org, so it is the default and supported path — a hand-rolled custom set that re-declares these permissions fails with . If a specific user's license lacks the underlying entitlement, the assignment surfaces that same exception so the operator can move the user to a profile/license that carries it.
IsContactCenterSupervisorOmniSupervisorManageQueueViewOmnichnlAnlytDshbrdContactCenterSupervisorFIELD_INTEGRITY_EXCEPTIONThat custom-permission-set warning does not mean assigning the existing Salesforce-shipped set removes access or rewrites the set. This skill only creates a missing ; it never creates, edits, or replaces the permission set itself.
ContactCenterSupervisorPermissionSetAssignmentInputs
bash
bash scripts/verify-and-assign.sh <org-alias> [count=1] [permission-set-names-csv=ContactCenterSupervisor]- (required).
org-alias - (optional, default
count, range1) — must match the supervisor user count.1..5 - (optional, default
permission-set-names-csv) — comma-separated for multiple. Every supervisor gets every listed set (cross-product).ContactCenterSupervisor
Preconditions and safety
- Target org authenticated via CLI, Service Cloud license,
sfCLI ≥ 2.139.6.sf - The supervisor users exist and are active; fewer than active users blocks with a remediation message.
count - The set is Salesforce-shipped and present on any Service-Cloud-enabled org; a custom name that is missing blocks with a Setup click-path.
ContactCenterSupervisor - The executing user has (standard on System Administrator) — required even for org admins.
PermissionsAssignPermissionSets - The three-way production guard applies — assigning permission sets on a production org can escalate a real user's privileges, so it blocks with no override.
safe_to_write
Run
verify-and-assign.sh- Compute ; derive the 8-char org suffix.
safe_to_write - Validate every supplied permission-set name as a well-formed DeveloperName (SOQL-injection guard) before any call.
sf - Resolve the users, filtered to
supervisor{1..N}.<suffix>@example.com; block if fewer thanIsActive=trueare active (an inactive occupant does not satisfy the count).count - Resolve each by name; block naming which is missing.
PermissionSet - Query existing for the (user × set) cross-product; compute the missing pairs.
PermissionSetAssignment - POST one assignment per missing pair (individual POSTs, no ); treat
allOrNoneas reused.DUPLICATE_VALUE - Re-query to confirm final state and emit the report.
Behavior
Cross-product. Every supervisor gets every listed set; a partial assignment is a failure, not a feature.
Idempotency. has a uniqueness constraint on (AssigneeId, PermissionSetId), so a re-POST raises ; the skill detects existing pairs first and treats that as reused for concurrent-run safety. POSTs are individual so one error never rolls back its siblings, and it re-queries after all POSTs — a 201 only means the write was accepted; a SOQL confirms it is active.
PermissionSetAssignmentDUPLICATE_VALUENon-destructive. Create-only; it never deletes existing assignments (supervisors may hold out-of-band permissions) and derives users from the supervisor pattern rather than an explicit id list.
Output contract
A single JSON object with ∈ | | | , the resolved , , , (= ), a snapshot, /, , an snapshot, , and .
statusassignedreusedpartialblockedpermission_setsorg_suffixrequested_countexpected_assignment_countrequested_count × len(permission_sets)beforeassigned_this_runassigned_countreused_countaftermanual_actionsblocking_issue- — at least one new assignment created; all expected pairs exist after.
assigned - — all expected pairs already existed; nothing POSTed.
reused - — some POSTs failed; final count is below expected.
partial - — precondition failed (production org, missing set, missing/inactive users, or a license that does not allow the permission).
blocked
assigned_count + reused_count == expected_assignment_countpartialblocking_issueblockedpartialLimitations
- Provisioning the user license that the supervisor permset requires is the users-create skill's responsibility, not this one.
- Assigns individual PermissionSets only — a is a different sObject and is out of scope.
PermissionSetGroup - Create-only; it does not remove assignments.
References
| File | When to read |
|---|---|
| Before the POST loop — PermissionSetAssignment schema, |