forcedotcom/sf-skills / skills/platform-policy-rule-generate
platform-policy-rule-generate
VerifiedTHE skill for creating a Data Cloud / Data Governance access policy — authors and deploys a PolicyRuleDefinitionSet + PolicyRuleDefinition pair (CRUD) covering OLS, FLS, RLS, masking/transform, and tag/classification-based access for the DATACLOUD or ALL consumer. TRIGGER when the user wants to create/write/author a Data Cloud or Data Governance policy, access policy, or policy rule, or to grant access to a Data Cloud object THROUGH A POLICY — a Data Cloud policy-create request routes here, not to the tag/classification surface. Resolves every reference via Data 360 MCP. SCOPE: Data Cloud policies only (not Security Center, DSAR, or User Access Policies). DO NOT TRIGGER to create tags/classifications, or to grant object/dataspace access via a PERMISSION SET / RBAC grant (use platform-dataspace-access-configure). For a vague object-access ask, surface both skills and ASK the permission-set way vs the policy way; if unsure the object is Data Cloud, ask which first.
references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition
View on GitHub<?xml version="1.0" encoding="UTF-8"?>
<PolicyRuleDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
<action>Read</action>
<category>RECORD_POLICY_RULE_DEFINITION</category>
<effect>Permit</effect>
<label>Rule 1</label>
<policyRuleDefinitionSetName>ExistsJoinRLS</policyRuleDefinitionSetName>
<policyRuleResourceDomains>
<resourceDomain>yourcontacts__dlm</resourceDomain>
</policyRuleResourceDomains>
<principalAuthenticationLevel>INTERNAL</principalAuthenticationLevel>
<principalScopeType>ANY</principalScopeType>
<resourceScopeType>RECORD</resourceScopeType>
<ruleConsumer>DATACLOUD</ruleConsumer>
<transformPrecedence>0</transformPrecedence>
<whenPolicyRuleDefinitionClauseConjunction>
<conditions>
<clause>WHEN</clause>
<operator>CONTAINS_ANY</operator>
<policyRuleValueSet>
<valueReference>cust_perm1</valueReference>
<valueReferenceType>CUSTOM_PERMISSION</valueReferenceType>
</policyRuleValueSet>
<principalPath>ASSIGNED_PERMISSIONS_PATH</principalPath>
</conditions>
<conditions>
<clause>WHEN</clause>
<operator>EQUALS</operator>
<policyRuleValueSet>
<valueText>sdfgd</valueText>
</policyRuleValueSet>
<principalExpression>
<soqlTarget>
<select>Department</select>
</soqlTarget>
<type>SOQLTARGETLISTEXPR</type>
<version>1</version>
</principalExpression>
<principalPath>SCALAR_ATTRIBUTE</principalPath>
</conditions>
<conditions>
<clause>WHEN</clause>
<operator>EQUALS</operator>
<principalExpression>
<soqlTarget>
<select>Email</select>
</soqlTarget>
<type>SOQLTARGETLISTEXPR</type>
<version>1</version>
</principalExpression>
<resourcePath>RECORDFIELD</resourcePath>
<valueDomain>yourcontacts__dlm:EMAIL__c</valueDomain>
<valuePrincipalPath>SCALAR_ATTRIBUTE</valuePrincipalPath>
</conditions>
<conditions>
<clause>WHEN</clause>
<operator>EXISTS</operator>
<policyRuleDefinitionCondition>
<clause>WHEN</clause>
<operator>EQUALS</operator>
<policyRuleValueSet>
<valueText>${User.Email}</valueText>
</policyRuleValueSet>
<resourcePath>RECORDFIELD</resourcePath>
<valueDomain>yourcontacts__dlm:EMAIL__c</valueDomain>
</policyRuleDefinitionCondition>
<resourceExpression>
<projection>
<join>
<alias>ci</alias>
<predicate>
<attribute>contacts_to_importcsv__dlm:EMAIL__c</attribute>
<comparator>EQUALS</comparator>
<on>
<field>EMAIL__c</field>
<resourceAlias>resource</resourceAlias>
<schema>yourcontacts__dlm</schema>
</on>
</predicate>
<schema>contacts_to_importcsv__dlm</schema>
</join>
</projection>
<type>PROJECTION</type>
<version>1</version>
</resourceExpression>
<resourcePath>EXPRESSION</resourcePath>
<whereClauseConjunction>1</whereClauseConjunction>
</conditions>
<conjunctionExpression>(AND (AND 1 2) (OR 3 4))</conjunctionExpression>
</whenPolicyRuleDefinitionClauseConjunction>
</PolicyRuleDefinition>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |