DCR RBAC — Role & Privilege Management
Create custom Snowflake roles and assign granular privileges for DCR Collaboration API operations.
When to Use
- User wants to create roles for DCR collaboration workflows
- User wants to grant or revoke DCR privileges (account-level or collaboration-level)
- User wants to set up persona-based access (data engineer, campaign manager, analyst, etc.)
- User says "create roles for clean rooms", "assign DCR privileges", "grant collaboration privileges", "RBAC for DCR"
Key Concepts
| Concept | Description |
|---|---|
| SAMOOHA_APP_ROLE | Built-in high-privilege role that can call all DCR procedures. The RBAC system lets you create more granular alternatives |
| Account-level privileges | Control what a role can do across the account (e.g., create collaborations, register templates) |
| Collaboration-level privileges | Control what a role can do within a specific collaboration (e.g., run analysis, link data) |
| Registry-level privileges | Control what a role can do within a custom registry (e.g., register or read items) |
| {DB} | The DCR database, typically SAMOOHA_BY_SNOWFLAKE_LOCAL_DB — discovered dynamically |
Privilege Reference
Account-Level Privileges
Granted via {DB}.ADMIN.GRANT_PRIVILEGE_ON_ACCOUNT_TO_ROLE('<privilege>', '<role>').
| Privilege | Allows |
|---|---|
CREATE COLLABORATION |
Create new collaborations via COLLABORATION.INITIALIZE |
JOIN COLLABORATION |
Join collaborations via COLLABORATION.JOIN |
REVIEW COLLABORATION |
Review collaboration invitations via COLLABORATION.REVIEW |
VIEW COLLABORATIONS |
List collaborations via COLLABORATION.VIEW_COLLABORATIONS |
REGISTER DATA OFFERING |
Register data offerings in the default registry |
REGISTER TEMPLATE |
Register templates in the default registry |
REGISTER CODE SPEC |
Register code specs in the default registry |
VIEW REGISTERED DATA OFFERINGS |
View registered offerings in the default registry |
VIEW REGISTERED TEMPLATES |
View registered templates in the default registry |
VIEW REGISTERED CODE SPECS |
View registered code specs in the default registry |
CREATE REGISTRY |
Create custom registries |
VIEW REGISTRIES |
List custom registries |
USE DCR AGENT |
Use the DCR Agent feature |
Collaboration-Level Privileges
Granted via {DB}.ADMIN.GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE('<privilege>', 'COLLABORATION', '<collab_name>', '<role>').
| Privilege | Allows |
|---|---|
READ |
Read collaboration metadata |
UPDATE |
Update collaboration (link data, add/remove templates — broad permission) |
GET STATUS |
Check collaboration status via COLLABORATION.GET_STATUS |
VIEW DATA OFFERINGS |
View data offerings in a collaboration |
LINK LOCAL DATA OFFERINGS |
Link local data offerings to a collaboration |
UNLINK LOCAL DATA OFFERINGS |
Unlink local data offerings from a collaboration |
VIEW TEMPLATES |
View templates in a collaboration |
VIEW CODE SPECS |
View code specs in a collaboration |
ADD TEMPLATE REQUEST |
Request to add a template to an existing collaboration |
REMOVE TEMPLATE |
Remove a template from a collaboration |
MANAGE UPDATE REQUEST |
Approve or reject collaboration update requests |
MANAGE TEMPLATE AUTO APPROVAL |
Enable/disable auto-approval for template requests |
VIEW UPDATE REQUESTS |
View pending update requests in a collaboration |
VIEW ACTIVATIONS |
View activation results |
PROCESS ACTIVATION |
Process activation segments |
RUN |
Run analysis/activation templates via COLLABORATION.RUN |
Note:
LINK DATA OFFERINGSandUNLINK DATA OFFERINGS(without "LOCAL") are not valid privileges — the API rejects them. OnlyLINK LOCAL DATA OFFERINGSandUNLINK LOCAL DATA OFFERINGSare supported.
Registry-Level Privileges
Granted via {DB}.ADMIN.GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE('<privilege>', 'REGISTRY', '<registry_name>', '<role>').
Used for custom registries. The default registry is accessible to anyone with the corresponding account-level privilege.
| Privilege | Allows |
|---|---|
REGISTER |
Register data offerings, templates, or code specs in a custom registry |
READ |
Read/view items in a custom registry |
Workflow
Step 0: Discover DCR Database
SHOW DATABASES LIKE 'SAMOOHA_BY_SNOWFLAKE_LOCAL_DB%';
Use the result as {DB} in all subsequent calls. If no database is found, inform the user that the DCR application is not installed.
Step 1: Determine Intent
Ask the user what they need:
| Intent | Next Step |
|---|---|
| Create a new role with DCR privileges | Step 2 |
| Grant privileges to an existing role | Step 3 |
| Grant collaboration-level privileges | Step 4 |
| Grant registry-level privileges | Step 4b |
| Revoke privileges | Step 5 |
| Set up a persona-based role (data engineer, campaign manager, etc.) | Step 6 |
Step 2: Create a New Role
Ask for the role name. Create the role and grant it to the user:
USE ROLE ACCOUNTADMIN;
CREATE ROLE IF NOT EXISTS <role_name>;
GRANT ROLE <role_name> TO USER <username>;
Then proceed to Step 3 to grant account-level privileges, or Step 6 for persona-based setup.
Step 3: Grant Account-Level Privileges
Present the account-level privileges table and ask which privileges to grant.
MANDATORY STOPPING POINT: Show the selected privileges and ask for confirmation before executing.
"I will grant the following account-level privileges to role
<role_name>:
<privilege_1><privilege_2>Proceed? (Yes/No/Modify)"
On confirmation, execute each grant:
USE ROLE ACCOUNTADMIN;
CALL {DB}.ADMIN.GRANT_PRIVILEGE_ON_ACCOUNT_TO_ROLE('<privilege>', '<role_name>');
Important — additional Snowflake grants required for some privileges:
| DCR Privilege | Also Requires |
|---|---|
CREATE COLLABORATION |
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role_name>; + GRANT CREATE SHARE ON ACCOUNT TO ROLE <role_name>; + GRANT CREATE DATABASE ON ACCOUNT TO ROLE <role_name>; + GRANT CREATE LISTING ON ACCOUNT TO ROLE <role_name>; + GRANT MANAGE SHARE TARGET ON ACCOUNT TO ROLE <role_name>; + GRANT APPLY ROW ACCESS POLICY ON ACCOUNT TO ROLE <role_name>; + GRANT CREATE APPLICATION ON ACCOUNT TO ROLE <role_name>; |
VIEW COLLABORATIONS |
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role_name>; |
REGISTER DATA OFFERING |
GRANT USAGE ON DATABASE <db> TO ROLE <role_name>; + GRANT USAGE ON SCHEMA <db>.<schema> TO ROLE <role_name>; + GRANT SELECT ON TABLE <db>.<schema>.<table> TO ROLE <role_name>; for each dataset table |
Step 4: Grant Collaboration-Level Privileges
Ask for:
- The collaboration name
- Which collaboration-level privileges to grant
MANDATORY STOPPING POINT: Show the selected privileges and ask for confirmation before executing.
Execute each grant:
USE ROLE ACCOUNTADMIN;
CALL {DB}.ADMIN.GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE(
'<privilege>',
'COLLABORATION',
'<collaboration_name>',
'<role_name>'
);
Step 4b: Grant Registry-Level Privileges
For custom registries only. Ask for:
- The registry name
- Which registry-level privileges to grant (
REGISTERorREAD)
Execute each grant:
USE ROLE ACCOUNTADMIN;
CALL {DB}.ADMIN.GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE(
'<privilege>',
'REGISTRY',
'<registry_name>',
'<role_name>'
);
Step 5: Revoke Privileges
Ask which privileges to revoke and at what scope (account, collaboration, or registry).
MANDATORY STOPPING POINT: Show the privileges to revoke and ask for confirmation.
Account-level revoke:
Note: There is no
REVOKE_PRIVILEGE_ON_ACCOUNT_FROM_ROLEprocedure yet. To remove account-level DCR privileges, revoke the database role directly:USE ROLE ACCOUNTADMIN; REVOKE DATABASE ROLE {DB}.<database_role> FROM ROLE <role_name>;Or drop and recreate the custom role.
Collaboration-level revoke:
USE ROLE ACCOUNTADMIN;
CALL {DB}.ADMIN.REVOKE_PRIVILEGE_ON_OBJECT_FROM_ROLE(
'<privilege>',
'COLLABORATION',
'<collaboration_name>',
'<role_name>'
);
Registry-level revoke:
USE ROLE ACCOUNTADMIN;
CALL {DB}.ADMIN.REVOKE_PRIVILEGE_ON_OBJECT_FROM_ROLE(
'<privilege>',
'REGISTRY',
'<registry_name>',
'<role_name>'
);
Step 6: Persona-Based Role Setup
Pre-defined privilege bundles for common personas. Ask which persona to set up, then confirm the privilege list before executing.
Persona selection guidance: Follow principle of least privilege. If the user says "create collaborations" (initiator), use Collaboration Creator. If "join collaborations" (joiner), use Collaboration Joiner. Only use Collaboration Owner / Admin when the user explicitly needs both sides or says "full lifecycle" / "end-to-end."
Freshly created roles: A newly created role has NO warehouse access. Always include GRANT USAGE ON WAREHOUSE <warehouse> TO ROLE <role>; when setting up a new role — without it, the role cannot execute any DCR procedures.
MANDATORY STOPPING POINT: Present the full privilege list for the selected persona and ask for confirmation before executing any grants.
Collaboration Creator
Creates new collaborations (initiator side). Includes JOIN COLLABORATION because after INITIALIZE, the creator must call JOIN() to join their own collaboration. Does NOT include VIEW COLLABORATIONS — not required to manage collaborations you created.
Account-level:
CREATE COLLABORATIONJOIN COLLABORATIONREGISTER DATA OFFERINGREGISTER TEMPLATEVIEW REGISTERED DATA OFFERINGSVIEW REGISTERED TEMPLATES
Collaboration-level (per collaboration created):
READUPDATEMANAGE UPDATE REQUESTMANAGE TEMPLATE AUTO APPROVAL
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;GRANT CREATE SHARE ON ACCOUNT TO ROLE <role>;GRANT CREATE DATABASE ON ACCOUNT TO ROLE <role>;GRANT CREATE LISTING ON ACCOUNT TO ROLE <role>;GRANT MANAGE SHARE TARGET ON ACCOUNT TO ROLE <role>;GRANT APPLY ROW ACCESS POLICY ON ACCOUNT TO ROLE <role>;GRANT CREATE APPLICATION ON ACCOUNT TO ROLE <role>;
Collaboration Joiner
Joins existing collaborations (joiner side). Does NOT include CREATE COLLABORATION. Use this for standard join flows where the collaborator accepts and joins directly. For invite-based review flows that require REVIEW COLLABORATION before joining, use Reviewer / Joiner instead.
Account-level:
JOIN COLLABORATIONVIEW COLLABORATIONSVIEW REGISTERED DATA OFFERINGSVIEW REGISTERED TEMPLATES
Collaboration-level (per collaboration joined):
READGET STATUS
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;
Collaboration Owner / Admin
Full lifecycle superset: creates AND joins collaborations, manages both sides end-to-end. Use this only when a single role genuinely needs to do everything. Prefer the narrower Collaboration Creator or Collaboration Joiner personas when intent is clear.
Account-level:
CREATE COLLABORATIONJOIN COLLABORATIONVIEW COLLABORATIONSREGISTER DATA OFFERINGREGISTER TEMPLATEVIEW REGISTERED DATA OFFERINGSVIEW REGISTERED TEMPLATES
Collaboration-level (per collaboration):
READUPDATEMANAGE UPDATE REQUESTMANAGE TEMPLATE AUTO APPROVAL
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;GRANT CREATE SHARE ON ACCOUNT TO ROLE <role>;GRANT CREATE DATABASE ON ACCOUNT TO ROLE <role>;GRANT CREATE LISTING ON ACCOUNT TO ROLE <role>;GRANT MANAGE SHARE TARGET ON ACCOUNT TO ROLE <role>;GRANT APPLY ROW ACCESS POLICY ON ACCOUNT TO ROLE <role>;GRANT CREATE APPLICATION ON ACCOUNT TO ROLE <role>;
Data Engineer
Registers data offerings and templates, links data to collaborations.
Account-level:
REGISTER DATA OFFERINGVIEW REGISTERED DATA OFFERINGSREGISTER TEMPLATEVIEW REGISTERED TEMPLATESVIEW COLLABORATIONS
Collaboration-level (per collaboration):
READVIEW DATA OFFERINGSLINK LOCAL DATA OFFERINGSUNLINK LOCAL DATA OFFERINGSUPDATEVIEW TEMPLATESVIEW UPDATE REQUESTSGET STATUS
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;GRANT USAGE ON DATABASE <db> TO ROLE <role>;GRANT USAGE ON SCHEMA <db>.<schema> TO ROLE <role>;GRANT SELECT ON TABLE <db>.<schema>.<table> TO ROLE <role>;(for each dataset)
Analyst / Analysis Runner
Runs analyses on existing collaborations.
Account-level:
VIEW COLLABORATIONSVIEW REGISTERED TEMPLATESVIEW REGISTERED DATA OFFERINGS
Collaboration-level (per collaboration):
READRUNVIEW DATA OFFERINGSVIEW TEMPLATESGET STATUS
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;
Campaign Manager (Activation)
Runs activation templates and processes segments.
Account-level:
VIEW COLLABORATIONSVIEW REGISTERED TEMPLATESVIEW REGISTERED DATA OFFERINGS
Collaboration-level (per collaboration):
READRUNVIEW DATA OFFERINGSVIEW TEMPLATESVIEW ACTIVATIONSPROCESS ACTIVATIONGET STATUS
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;
Reviewer / Joiner
Reviews and joins collaborations created by others. Use this for invite-based flows where the collaborator must review (approve/reject) before joining. If no review step is needed, use Collaboration Joiner instead.
Account-level:
REVIEW COLLABORATIONJOIN COLLABORATIONVIEW COLLABORATIONS
Additional Snowflake grants:
GRANT IMPORT SHARE ON ACCOUNT TO ROLE <role>;
Registry Manager
Creates and manages custom registries.
Account-level:
CREATE REGISTRYVIEW REGISTRIES
Registry-level (per custom registry):
REGISTERREAD
Known Issues & Workarounds
| Issue | Workaround |
|---|---|
REGISTER DATA OFFERING does NOT automatically grant VIEW REGISTERED DATA OFFERINGS |
Always grant both explicitly |
REGISTER TEMPLATE does NOT automatically grant VIEW REGISTERED TEMPLATES |
Always grant both explicitly |
RUN on a collaboration does NOT grant READ |
Always grant READ alongside RUN |
LINK LOCAL DATA OFFERING fails if a prior call was made by a different role on the same collaboration |
Known TABLE_NAMES ownership bug — use same role for all link operations on a collaboration, or use SAMOOHA_APP_ROLE |
VIEW COLLABORATIONS requires both DCR privilege AND IMPORT SHARE |
Always grant IMPORT SHARE ON ACCOUNT alongside VIEW COLLABORATIONS |
| Data offering registration requires SELECT on underlying tables | Grant USAGE on database/schema and SELECT on tables before registering |
| Custom registry items not visible to other roles | Grant READ on the custom registry via GRANT_PRIVILEGE_ON_OBJECT_TO_ROLE |
Execution Notes
- All
GRANT_PRIVILEGE_ON_ACCOUNT_TO_ROLEandGRANT_PRIVILEGE_ON_OBJECT_TO_ROLEcalls must be made withACCOUNTADMINrole (or a role with equivalent privileges) - Collaboration-level privileges can only be granted after the collaboration exists and the granting role has access to it
- Registry-level privileges use object type
'REGISTRY'(not'COLLABORATION')
Stopping Points
- Before granting account-level privileges: Show privilege list and get user confirmation
- Before granting collaboration-level privileges: Show privilege list and get user confirmation
- Before granting registry-level privileges: Show privilege list and get user confirmation
- Before revoking any privileges: Show revoke list and get user confirmation
- Before executing persona-based setup: Show full privilege bundle and get user confirmation
Resume rule: Upon user approval, proceed directly without re-asking.
Output
| Operation | Output |
|---|---|
| Create role | Role creation confirmation |
| Grant privileges | List of granted privileges with confirmation |
| Revoke privileges | List of revoked privileges with confirmation |
| Persona setup | Complete privilege bundle granted with confirmation |