PranavNagrecha/AwesomeSalesforceSkills / skills/admin/delegated-administration
delegated-administration
VerifiedUse when configuring delegated administration to allow non-system-admin users to manage specific user groups, reset passwords, assign permission sets, or administer custom objects. Covers the DelegateGroup metadata type (delegateGroups/*.delegateGroup-meta.xml), its roles / profiles / permissionSets / permissionSetGroups / groups / customObjects / loginAccess fields, delegate-group log-in-as, and the deploy and review path for them. NOT for creating, deactivating or licensing users yourself — use admin/user-management. NOT for auto-assigning permission sets from user attributes — use admin/user-access-policies.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 26.3 KB |
| references/examples.md | markdown | 6.1 KB |
| references/gotchas.md | markdown | 17.1 KB |
| references/llm-anti-patterns.md | markdown | 10.4 KB |
| references/metadata-examples.md | markdown | 12.0 KB |
| references/well-architected.md | markdown | 7.5 KB |
| scripts/check_delegated_administration.pyexecutable | script | 15.9 KB |
| templates/delegated-administration-template.md | markdown | 4.8 KB |
references/examples.md
View on GitHub# Examples — Delegated Administration
## Example 1: Regional HR Coordinator Managing APAC Users
**Context:** A global Salesforce org has sales users organized by region in the role hierarchy. APAC has 40 users under an "APAC Sales" role branch. The APAC HR Coordinator (not a System Admin) needs to onboard new APAC sales reps, reset passwords, and assign the standard "APAC Sales Rep" profile. Previously, every onboarding request required a ticket to the central IT team.
**Problem:** Without delegated administration, the HR Coordinator has no way to create or edit user records. Adding them as a System Administrator would give them org-wide access, violating least-privilege requirements. There is no native way to scope user management to a role branch using profiles or permission sets alone.
**Solution:**
Configuration steps (no code — UI only):
```
Setup > Users > Delegated Administrators > New
Group Name: APAC HR Admin Group
Delegated Administrators related list:
Add: apac.hr@example.com (the HR coordinator user)
Users in Delegated Group related list:
Add roles: APAC Sales Manager, APAC Sales Rep, APAC Sales SDR
(All subordinate roles are automatically included)
Assignable Profiles related list:
Add: APAC Sales Rep (standard user profile for this region)
No Custom Object Administration needed.
```
Then on the HR Coordinator's profile:
```
Setup > Profiles > [HR Coordinator Profile] > System Permissions
Enable: View Setup and Configuration (ViewSetup)
Enable: Manage Users (ManageUsers)
```
The Metadata API Developer Guide grounds only the first of these: "Only users with the 'View Setup and Configuration' permission can be delegated administrators." UNVERIFIED (2026-09-04): the Manage Users line is retained from the original Salesforce Help walkthrough and is not confirmed by the Metadata API Developer Guide or the Object Reference — enable it, but verify in the org before documenting it as the requirement (`references/gotchas.md` #1).
The equivalent deployable file, rather than the click-path above, is in `references/metadata-examples.md`:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<DelegateGroup xmlns="http://soap.sforce.com/2006/04/metadata">
<label>APAC HR Admin Group</label>
<loginAccess>false</loginAccess>
<profiles>APAC Sales Rep</profiles>
<roles>APAC_Sales_Manager</roles>
<roles>APAC_Sales_Rep</roles>
<roles>APAC_Sales_SDR</roles>
</DelegateGroup>
```
`loginAccess` is `false` because onboarding and password resets need no impersonation — but the field is required, so it has to be written either way.
**Why it works:** The group configuration scopes user management to only users in the APAC role branch. The HR Coordinator can create users, edit details, and reset passwords only for users in those roles. She cannot assign any profile except "APAC Sales Rep," preventing accidental over-provisioning. System Administrator users in the same region remain protected.
---
## Example 2: Business Unit Owner Extending a Custom Object
**Context:** A product operations team owns a custom object `Product_Request__c` used to track internal requests. The Ops Manager needs to add custom fields and update page layouts as the process evolves, but the central Salesforce team has a 2-week backlog. Opening full Setup access is not acceptable under the company's security policy.
**Problem:** Without custom object administration rights, the Ops Manager must raise every field or layout change with the central admin. Granting System Administrator or a cloned admin profile would expose unrelated Setup areas (security settings, org-wide defaults, connected apps).
**Solution:**
```
Setup > Users > Delegated Administrators > New
Group Name: Product Ops Custom Object Admin
Delegated Administrators related list:
Add: ops.manager@example.com
Users in Delegated Group (roles):
(Leave empty — this group is for custom object admin only, not user management)
Assignable Profiles / Permission Sets / Groups:
(Leave empty — with no roles there is no population for them to act on;
the guide scopes all three to "users in specified roles and all
subordinate roles", so entries here would be dead configuration)
Enable Group for Login Access (loginAccess): false
Custom Object Administration related list:
Add: Product_Request__c
```
The Ops Manager's profile must grant **View Setup and Configuration** to reach the delegated admin area at all, even though this group manages no users. UNVERIFIED (2026-09-04): whether **Manage Users** is additionally required for a custom-object-only group is not documented in the Metadata API Developer Guide — test before promising it either way.
**Why it works:** The Ops Manager can now navigate to Setup > Object Manager > Product_Request__c and modify fields, page layouts, and validation rules independently. They cannot see or touch any other Setup area, any other custom object, or any user records. Audit trail (Setup Audit Trail) records all changes under the Ops Manager's user ID, maintaining traceability.
---
## Anti-Pattern: Adding Parent Roles That Are Too High in the Hierarchy
**What practitioners do:** When setting up a Delegated Administrator group for a business unit, an admin adds the top-level regional role (e.g., "APAC VP") to the "Users in Delegated Group" list, thinking it will scope access to the APAC region cleanly.
**What goes wrong:** Salesforce includes all subordinate roles automatically. If "APAC VP" is the parent of APAC Sales, APAC Finance, APAC Legal, and APAC Operations branches, the delegated admin can now manage users across all of those branches — not just the intended sales team. Finance and Legal users are now visible and editable by the HR Coordinator who was only supposed to manage sales users.
**Correct approach:** Add the most specific roles that represent the actual scope. For sales onboarding, add "APAC Sales Manager" and its direct children — not the top of the APAC hierarchy. If the scope genuinely spans multiple branches, create separate Delegated Administrator groups per branch or carefully enumerate only the exact roles needed.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |