generating-permission-set

Generate deployable Salesforce PermissionSet XML with object, field, and user permissions.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-permission-set-forcedotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generating-permission-set
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/generating-permission-set
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill generating-permission-set-forcedotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It removes the trial-and-error required to create correct Salesforce PermissionSet (PermissionSet XML) by producing metadata that matches platform rules and deployment expectations.

Core Features & Use Cases

  • CRUD and access generation: Creates deployable object permissions (create/read/edit/delete) and record visibility controls for standard and custom objects.
  • Field-level security (FLS) safety: Generates fieldPermissions for readable/editable access while avoiding deployment failures caused by including required fields.
  • User, app, and tab visibility: Adds system userPermissions plus applicationVisibilities and tabSettings so the right capabilities and UI elements are available to assigned users.
  • Optional Apex/Visualforce access and record type settings: Grants class/page access and configures license/record-type visibility when needed.

Quick Start

Use the generating-permission-set skill to create PermissionSet XML for a user role by specifying the permission set fullName, object CRUD rules, and the non-required fields that should be readable and editable.

Frequently Asked Questions about generating-permission-set

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a deployable Salesforce permission set with field-level security?

To generate a deployable Salesforce permission set, create PermissionSet XML defining object CRUD rules and fieldPermissions for non-required fields. Omitting required fields from fieldPermissions prevents deployment failures while ensuring valid least-privilege access controls.

Why does my Salesforce permission set deployment fail when including required fields in fieldPermissions?

Salesforce permission set deployment fails when required fields are included in fieldPermissions because the platform enforces constraints on required field access. Generating valid metadata requires omitting required fields from fieldPermissions to match platform rules and avoid deployment errors.

Can I configure Apex class access and tab visibility in a Salesforce permission set XML?

Yes, you can configure Apex class access and tab visibility in Salesforce permission set XML by adding classAccess elements and tabSettings. The metadata also supports applicationVisibilities and userPermissions to grant system capabilities and UI element visibility to assigned users.

What's the best way to create least-privilege access controls for Salesforce custom objects?

The best way to create least-privilege access controls for Salesforce custom objects is generating PermissionSet XML with specific objectPermissions for CRUD operations and fieldPermissions for readable or editable non-required fields, ensuring deployment-ready valid metadata.

Does the Metadata API support generating permission sets with record type visibility settings?

Yes, the Metadata API supports generating permission sets with record type visibility settings. PermissionSet XML can include recordTypeVisibilities to configure license and record-type visibility for assigned users alongside standard object and field-level security configurations.

How do I add user permissions and application visibility to a Salesforce permission set?

To add user permissions and application visibility to a Salesforce permission set, include userPermissions and applicationVisibilities elements in the PermissionSet XML. This ensures assigned users receive the correct system capabilities and UI element access upon deployment.