service-omni-supervisor-permset-assign
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseservice-omni-supervisor-permset-assign
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.
ContactCenterSupervisorPermissionSetAssignment通过将Salesforce自带的标准 PermissionSet分配给现有主管用户。经典的Omni-Channel主管UI(指挥中心)要求主管拥有联络中心主管权限,之后才能绑定他们。本技能采用“先检测后POST”的幂等性机制,并将视为已完成的分配。
PermissionSetAssignmentContactCenterSupervisorservice-omni-supervisor-config-deployDUPLICATE_VALUE许可说明。主管系统权限(、、)受权限集许可证限制。标准的权限集自带许可证关联,可在启用Service Cloud的组织中顺利分配,因此是默认且受支持的方案——若手动创建自定义权限集并重新声明这些权限,会触发异常。如果特定用户的许可证缺少基础权限,分配操作会触发相同异常,以便操作人员将用户转移到具备相应权限的配置文件/许可证。
IsContactCenterSupervisorOmniSupervisorManageQueueViewOmnichnlAnlytDshbrdContactCenterSupervisorFIELD_INTEGRITY_EXCEPTION请注意,上述自定义权限集的警告并不意味着分配Salesforce自带的权限集会移除现有访问权限或重写该权限集。本技能仅会创建缺失的;绝不会创建、编辑或替换权限集本身。
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
bash
bash scripts/verify-and-assign.sh <org-alias> [count=1] [permission-set-names-csv=ContactCenterSupervisor]- (必填)。
org-alias - (可选,默认值
count,范围1)——必须与主管用户数量匹配。1..5 - (可选,默认值
permission-set-names-csv)——多个权限集用逗号分隔。每位主管会获得列表中的所有权限集(交叉分配)。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
- 目标组织已通过CLI完成身份验证,具备Service Cloud许可证,且
sfCLI版本≥2.139.6。sf - 主管用户已存在且处于激活状态;若激活用户数量少于,则会触发阻断并显示修复提示信息。
count - 权限集是Salesforce自带的,在任何启用Service Cloud的组织中都存在;若指定的自定义权限集名称不存在,则会触发阻断并显示设置路径。
ContactCenterSupervisor - 执行用户拥有权限(系统管理员默认具备)——即使是组织管理员也需要该权限。
PermissionsAssignPermissionSets - 启用三方生产环境防护——在生产组织中分配权限集可能会提升真实用户的权限,因此会直接阻断且无法覆盖。
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.
verify-and-assign.sh- 计算状态;生成8位字符的组织后缀。
safe_to_write - 在调用任何命令前,验证所有提供的权限集名称是否为格式规范的DeveloperName(防止SOQL注入)。
sf - 解析用户,筛选出
supervisor{1..N}.<suffix>@example.com的用户;若激活用户数量少于IsActive=true则阻断(非激活用户不计入数量)。count - 根据名称解析每个;若名称不存在则阻断。
PermissionSet - 查询现有中的(用户×权限集)交叉配对;计算缺失的配对。
PermissionSetAssignment - 为每个缺失的配对单独POST分配请求(无设置);将
allOrNone视为已复用。DUPLICATE_VALUE - 重新查询以确认最终状态并生成报告。
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.
交叉分配。每位主管会获得列表中的所有权限集;部分分配视为失败,而非功能特性。
幂等性。对(AssigneeId, PermissionSetId)存在唯一性约束,因此重复POST会触发错误;本技能会先检测已存在的配对,并将其视为已复用,以确保并发运行的安全性。POST请求是单独发送的,因此一个错误不会回滚其他请求,且所有POST完成后会重新查询——状态码201仅表示写入已被接受;SOQL查询会确认权限是否已激活。
PermissionSetAssignmentDUPLICATE_VALUE非破坏性。仅创建新分配;绝不会删除现有分配(主管可能拥有额外的权限),且用户是从主管模式派生而来,而非通过显式ID列表指定。
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_issueblockedpartial返回单个JSON对象,其中的取值为 | | | ,包含已解析的、、、(= )、快照、/、、快照、和。
statusassignedreusedpartialblockedpermission_setsorg_suffixrequested_countexpected_assignment_countrequested_count × len(permission_sets)beforeassigned_this_runassigned_countreused_countaftermanual_actionsblocking_issue- ——至少创建了一个新分配;所有预期配对在操作后均存在。
assigned - ——所有预期配对已存在;未执行任何POST操作。
reused - ——部分POST请求失败;最终数量低于预期。
partial - ——前置条件不满足(生产组织、权限集缺失、用户缺失/未激活、或许可证不支持该权限)。
blocked
除非状态为,否则;仅当状态为/时,不为空。
partialassigned_count + reused_count == expected_assignment_countblockedpartialblocking_issueLimitations
限制说明
- 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.
- 主管权限集所需的用户许可证配置由用户创建技能负责,而非本技能。
- 仅分配单个PermissionSet——是不同的sObject,不在本技能的范围内。
PermissionSetGroup - 仅支持创建操作;不会移除已有的分配。
References
参考文档
| File | When to read |
|---|---|
| Before the POST loop — PermissionSetAssignment schema, |
| 文件 | 阅读时机 |
|---|---|
| 在POST循环之前阅读——包含PermissionSetAssignment架构、 |