跳到主要内容
知仓学习社ZHICANG

service-omni-supervisor-permset-assign

Use to assign the Salesforce-shipped standard ContactCenterSupervisor PermissionSet (default) to N existing supervisor users via PermissionSetAssign…

不碰外部(只输出文字)无严重或高危命中forcedotcom/sf-skills

它会碰到什么

扫了多少3 个文本文件,23 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

service-omni-supervisor-permset-assign

Assign the Salesforce-shipped standard ContactCenterSupervisor PermissionSet to existing supervisor users via PermissionSetAssignment. The classic Omni-Channel Supervisor UI (Command Center) requires supervisors to hold contact-center supervisor permissions before service-omni-supervisor-config-deploy can bind them. The skill uses detect-before-POST idempotency and treats DUPLICATE_VALUE as an already-satisfied assignment.

Licensing. The supervisor system permissions (IsContactCenterSupervisor, OmniSupervisorManageQueue, ViewOmnichnlAnlytDshbrd) are gated by a permission-set license. The standard ContactCenterSupervisor 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 FIELD_INTEGRITY_EXCEPTION. 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.

That custom-permission-set warning does not mean assigning the existing Salesforce-shipped ContactCenterSupervisor set removes access or rewrites the set. This skill only creates a missing PermissionSetAssignment; it never creates, edits, or replaces the permission set itself.

Inputs

bash scripts/verify-and-assign.sh <org-alias> [count=1] [permission-set-names-csv=ContactCenterSupervisor]
  • org-alias (required).
  • count (optional, default 1, range 1..5) — must match the supervisor user count.
  • permission-set-names-csv (optional, default ContactCenterSupervisor) — comma-separated for multiple. Every supervisor gets every listed set (cross-product).

Preconditions and safety

  • Target org authenticated via sf CLI, Service Cloud license, sf CLI ≥ 2.139.6.
  • The supervisor users exist and are active; fewer than count active users blocks with a remediation message.
  • The ContactCenterSupervisor set is Salesforce-shipped and present on any Service-Cloud-enabled org; a custom name that is missing blocks with a Setup click-path.
  • The executing user has PermissionsAssignPermissionSets (standard on System Administrator) — required even for org admins.
  • The three-way safe_to_write production guard applies — assigning permission sets on a production org can escalate a real user's privileges, so it blocks with no override.

Run

verify-and-assign.sh performs the whole cycle:

  1. Compute safe_to_write; derive the 8-char org suffix.
  2. Validate every supplied permission-set name as a well-formed DeveloperName (SOQL-injection guard) before any sf call.
  3. Resolve the supervisor{1..N}.<suffix>@example.com users, filtered to IsActive=true; block if fewer than count are active (an inactive occupant does not satisfy the count).
  4. Resolve each PermissionSet by name; block naming which is missing.
  5. Query existing PermissionSetAssignment for the (user × set) cross-product; compute the missing pairs.
  6. POST one assignment per missing pair (individual POSTs, no allOrNone); treat DUPLICATE_VALUE as reused.
  7. 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. PermissionSetAssignment has a uniqueness constraint on (AssigneeId, PermissionSetId), so a re-POST raises DUPLICATE_VALUE; 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.

Non-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 statusassigned | reused | partial | blocked, the resolved permission_sets, org_suffix, requested_count, expected_assignment_count (= requested_count × len(permission_sets)), a before snapshot, assigned_this_run/assigned_count, reused_count, an after snapshot, manual_actions, and blocking_issue.

  • assigned — at least one new assignment created; all expected pairs exist after.
  • reused — all expected pairs already existed; nothing POSTed.
  • partial — some POSTs failed; final count is below expected.
  • blocked — precondition failed (production org, missing set, missing/inactive users, or a license that does not allow the permission).

assigned_count + reused_count == expected_assignment_count unless partial; blocking_issue is non-null only for blocked/partial.

Limitations

  • Provisioning the user license that the supervisor permset requires is the users-create skill's responsibility, not this one.
  • Assigns individual PermissionSets only — a PermissionSetGroup is a different sObject and is out of scope.
  • Create-only; it does not remove assignments.

References

| File | When to read |

|---|---|

| references/api-notes.md | Before the POST loop — PermissionSetAssignment schema, DUPLICATE_VALUE semantics, and why users are derived from the supervisor pattern rather than an explicit id list |

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。