Skip to content

PranavNagrecha/AwesomeSalesforceSkills / skills/admin/delegated-administration

delegated-administration

Verified

Use 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.

references/well-architected.md

View on GitHub
# Well-Architected Notes — Delegated Administration

## Relevant Pillars

- **Security** — Delegated administration is a direct implementation of the principle of least privilege. Rather than granting System Administrator access for routine user management tasks, it scopes admin rights to only the users, profiles, and objects that a business role legitimately needs to manage. Poorly configured groups (overly broad role scope, unrestricted assignable profiles) create privilege escalation vectors. The platform enforces one hard security boundary: System Administrator users are always protected from delegated admin actions.

- **Operational Excellence** — Delegated administration reduces the operational bottleneck of centralizing all user management with the Salesforce admin team. By delegating routine tasks (onboarding, password resets, profile assignments) to regional or departmental coordinators, the admin team can focus on architecture-level work. The tradeoff is that the admin team must maintain the Delegated Administrator groups as the org evolves — stale groups, outdated role assignments, and missing profile entries are the primary operational failure modes.

- **Reliability** — Not directly applicable. Delegated administration does not affect org availability or data reliability.

- **Performance** — Not applicable. Delegated administration is a configuration feature with no meaningful performance implications.

- **Scalability** — As the org grows, the number of delegated groups may need to grow proportionally with business units or regions. The feature supports multiple independent groups, which scales well. However, the admin overhead of maintaining group configurations at scale is a real concern — automated auditing (e.g., using the checker script in this skill) is recommended for orgs with many groups.

---

## Architectural Tradeoffs

**Least privilege vs. operational friction:** Tight scoping (narrow role lists, minimal assignable profiles) maximizes security but increases the likelihood that delegated admins encounter "permission denied" scenarios for legitimate tasks. The right balance is to start narrow and expand based on documented operational need, not to start broad for convenience.

**Single large group vs. multiple targeted groups:** A single Delegated Administrator group covering all business units simplifies setup but creates a risk surface — a misconfigured group affects all delegated admins in it. Multiple smaller groups (one per region or department) are safer and easier to audit but require more ongoing maintenance. For orgs with 5+ business units, multiple groups is the recommended architecture.

**Custom object admin rights:** Granting custom object administration reduces change management overhead for fast-evolving custom objects but creates a risk of unauthorized field or validation rule changes that affect downstream integrations or reports. Gate this based on the business unit's maturity and the sensitivity of the object.

---

## Anti-Patterns

1. **Granting full System Administrator profile for convenience** — When a delegated admin frequently hits permission gaps (e.g., can't manage a roleless user, can't touch a System Admin), the path of least resistance is to promote them to full System Administrator. This eliminates the security scoping entirely and is the most common anti-pattern. The correct response is to fix the root cause (assign roles to users, route System Admin requests properly) rather than expanding access.

2. **Configuring assignable profiles that are too permissive** — Including high-privilege profiles (System Administrator, "Power User" with API access) in a Delegated Administrator group's Assignable Profiles list allows the delegated admin to effectively escalate any user's privileges. Assignable profiles should be limited to the specific non-privileged profiles the delegated admin's business role legitimately needs to assign.

3. **Neglecting group maintenance as the org evolves** — Role hierarchies change, profiles are renamed or retired, and business units restructure. Delegated Administrator groups that are not updated become either too broad (old roles that now cover new unintended departments) or broken (assignable profiles that no longer exist). Scheduled audits using the `check_delegated_administration.py` script are the recommended mitigation.

---

## Official Sources Used

- Metadata API Developer Guide, `DelegateGroup` — *Fields* table — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (grounds the eight fields and their exact semantics: `roles` as "the roles and subordinates for which delegated administrators of the group can create and edit users"; `profiles` / `permissionSets` / `permissionSetGroups` / `groups` as assignment menus scoped to "users in specified roles and all subordinate roles"; `customObjects` covering "nearly every aspect … including creating a custom tab" but not relationships or org-wide sharing defaults; `label` and `loginAccess` as required — SKILL.md § Core Concepts, gotchas #3, #4, #6, #7, #8, #11)
- Metadata API Developer Guide, `DelegateGroup` — *Special Access Rules* — same PDF (grounds "Only users with the 'View Setup and Configuration' permission can be delegated administrators. As of Spring '20 and later, only users with 'View Setup' or 'Configuration' permission can access this object" — SKILL.md § Before Starting, gotcha #1, and the checker's `ViewSetup` report)
- Metadata API Developer Guide, `DelegateGroup` — *File Suffix and Directory Location*, *Version*, *Declarative Metadata Sample Definition*, *Wildcard Support* — same PDF (grounds the `.delegateGroup` suffix and `delegateGroups` folder, API 36.0+, the sample XML reproduced verbatim, and `*` wildcard support — `references/metadata-examples.md`)
- Metadata API Developer Guide, `SecuritySettings` — `canUsersGrantLoginAccess`, `enableAdminLoginAsAnyUser` — same PDF (grounds the org-level settings behind the guide's "depending on your organization settings, individual users must grant login access" caveat on `loginAccess` — gotcha #6)
- Metadata API Developer Guide, `Profile` and `OrgPreferenceSettings.enableProfileFiltering` (API 50.0+) — same PDF (grounds that "set up delegated admins where looking up profiles is needed to identify assignable profiles" and "administer an org as a delegated admin to view and assign profiles of the delegated group" expose profile names despite Profile Filtering — gotcha #10)
- Metadata API Developer Guide, `Role` / `RoleOrTerritory` — same PDF (grounds that a role's `fullName` "corresponds to Role Name in the user interface", so `roles` entries are role API names — `references/metadata-examples.md`)
- Object Reference for the Salesforce Platform — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/object_reference.pdf (searched for `DelegateGroup`, `DelegateGroupMember`, `DelegateGroupGrant`: **no delegate-group SObject is documented**, which is why this skill's verification path is a retrieve round-trip plus Setup rather than SOQL — `references/metadata-examples.md` § Verification, gotcha #2)
- Salesforce Well-Architected Overview — https://architect.salesforce.com/docs/architect/well-architected/guide/overview.html (pillar framing for the Security / Operational Excellence tradeoffs above)
- Salesforce Help: Set Up Delegated Administration — https://help.salesforce.com/s/articleView?id=sf.admin_delegate.htm (original grounding for the Setup click-path in `references/examples.md`; not re-fetchable — help.salesforce.com does not serve to tooling, so the Setup steps carry no PDF citation)
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall