Setting Up Role-Based Access Control in Snowflake: A Template for Growing Teams
Last updated: October 2026
Quick answer: Create functional roles (DATA_ENGINEER, DATA_ANALYST, etc.) under SYSADMIN, grant specific privileges per role, use future grants so new tables auto-inherit permissions, create service users with TYPE = SERVICE and key-pair authentication, and never use ACCOUNTADMIN for daily work. This article includes a complete SQL script you can run to set up a multi-team RBAC environment from scratch.
Snowflake's Built-In Role Hierarchy
Every Snowflake account has a set of system-defined roles. Understanding the hierarchy is the first step to building your own:
- GLOBALORGADMIN: manages the organization from the organization account. Snowflake's documentation says ORGADMIN will be phased out in a future release, with organization administrators moving to GLOBALORGADMIN.
- ORGADMIN: manages organization-level operations across multiple accounts. Most teams never use it directly.
- ACCOUNTADMIN: the top-level role within an account. It can do everything, including creating warehouses, managing billing and reading all data. This is your break-glass role, not your daily driver.
- SECURITYADMIN: manages grants on any object through the MANAGE GRANTS privilege, and inherits everything USERADMIN can do. Use it for privilege management.
- USERADMIN: creates and manages users and roles. This is the role for CREATE USER and CREATE ROLE.
- SYSADMIN: creates and manages databases, schemas, warehouses and other objects. All custom roles should roll up to SYSADMIN so it can manage the objects they create.
- PUBLIC: every user automatically has this role. Grant the absolute minimum here, usually nothing.
Why You Should Never Use ACCOUNTADMIN Daily
Three concrete reasons. First, blast radius: every accidental DROP DATABASE hits every database in the account. Second, audit trail: when 8 people share ACCOUNTADMIN, your audit logs show the same role for every action, so you can't tell who did what. Third, compliance: SOC 2 and HIPAA auditors specifically look for least-privilege enforcement. If your data engineers are running queries as ACCOUNTADMIN, that's a finding.
Designing Your Role Hierarchy
Here's a role template that works for most data teams of 5 to 50 people. You'll create functional roles for each team function and grant them to SYSADMIN so the hierarchy stays clean:
| Role | Purpose | Typical Privileges |
|---|---|---|
DATA_ENGINEER | Build and maintain pipelines | CREATE TABLE, INSERT, UPDATE, DELETE, CREATE TASK, CREATE STREAM on assigned schemas, plus EXECUTE TASK on the account |
DATA_ANALYST | Query and report on data | SELECT on analytics schemas, USAGE on BI warehouse |
DATA_SCIENTIST | Explore data, build models | SELECT on analytics + raw schemas, USAGE on ML warehouse, CREATE STAGE |
BI_DEVELOPER | Build dashboards and semantic layers | SELECT on analytics schemas, USAGE on BI warehouse |
APP_SERVICE_ACCOUNT | Application-level read access | SELECT on specific views only, USAGE on app warehouse with tight resource monitor |
One default works against this design. New users have DEFAULT_SECONDARY_ROLES set to ALL, so every role granted to a user is active as a secondary role in each session. A user who holds both DATA_ENGINEER and DATA_ANALYST therefore acts with the privileges of both, except for CREATE statements, which use the primary role. Where each session should be limited to one functional role, set DEFAULT_SECONDARY_ROLES = () on those users or run USE SECONDARY ROLES NONE.
Does this need to survive an audit? Role hierarchies, masking policies and row access rules are quick to draw and hard to keep correct once several teams are changing them. We implement the model in your account and leave behind the tests that prove it still holds next quarter.
Book a governance review Data engineering servicesComplete SQL Setup Script
Run this as USERADMIN to create roles and users, SYSADMIN to create databases and warehouses, and SECURITYADMIN for the grants. The script sets up the full role template from the table above:
-- ============================================ -- Step 1: Create functional roles (as USERADMIN) -- ============================================ USE ROLE USERADMIN; CREATE ROLE IF NOT EXISTS DATA_ENGINEER; CREATE ROLE IF NOT EXISTS DATA_ANALYST; CREATE ROLE IF NOT EXISTS DATA_SCIENTIST; CREATE ROLE IF NOT EXISTS BI_DEVELOPER; CREATE ROLE IF NOT EXISTS APP_SERVICE_ACCOUNT; -- Grant all custom roles to SYSADMIN (maintains hierarchy) GRANT ROLE DATA_ENGINEER TO ROLE SYSADMIN; GRANT ROLE DATA_ANALYST TO ROLE SYSADMIN; GRANT ROLE DATA_SCIENTIST TO ROLE SYSADMIN; GRANT ROLE BI_DEVELOPER TO ROLE SYSADMIN; GRANT ROLE APP_SERVICE_ACCOUNT TO ROLE SYSADMIN; -- ============================================ -- Step 2: Create warehouses (as SYSADMIN) -- Without GENERATION, new standard warehouses are Gen2 where available, -- and query acceleration is on by default. -- ============================================ USE ROLE SYSADMIN; CREATE WAREHOUSE IF NOT EXISTS ETL_WH WAREHOUSE_SIZE = 'MEDIUM' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE; CREATE WAREHOUSE IF NOT EXISTS BI_WH WAREHOUSE_SIZE = 'SMALL' AUTO_SUSPEND = 120 AUTO_RESUME = TRUE; CREATE WAREHOUSE IF NOT EXISTS ML_WH WAREHOUSE_SIZE = 'LARGE' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE; CREATE WAREHOUSE IF NOT EXISTS APP_WH WAREHOUSE_SIZE = 'XSMALL' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE ENABLE_QUERY_ACCELERATION = FALSE; -- keep the app warehouse's cost predictable -- ============================================ -- Step 3: Grant warehouse access -- ============================================ USE ROLE SECURITYADMIN; GRANT USAGE ON WAREHOUSE ETL_WH TO ROLE DATA_ENGINEER; GRANT USAGE ON WAREHOUSE BI_WH TO ROLE DATA_ANALYST; GRANT USAGE ON WAREHOUSE BI_WH TO ROLE BI_DEVELOPER; GRANT USAGE ON WAREHOUSE ML_WH TO ROLE DATA_SCIENTIST; GRANT USAGE ON WAREHOUSE APP_WH TO ROLE APP_SERVICE_ACCOUNT; -- ============================================ -- Step 4: Create databases and schemas (as SYSADMIN) -- ============================================ USE ROLE SYSADMIN; CREATE DATABASE IF NOT EXISTS RAW_DB; CREATE DATABASE IF NOT EXISTS ANALYTICS_DB; CREATE SCHEMA IF NOT EXISTS RAW_DB.INGESTION; CREATE SCHEMA IF NOT EXISTS RAW_DB.STAGING; CREATE SCHEMA IF NOT EXISTS ANALYTICS_DB.MARTS; CREATE SCHEMA IF NOT EXISTS ANALYTICS_DB.REPORTS; -- ============================================ -- Step 5: Database, schema and object privileges -- ============================================ USE ROLE SECURITYADMIN; -- DATA_ENGINEER: build in RAW_DB, read and create in ANALYTICS_DB GRANT USAGE ON DATABASE RAW_DB TO ROLE DATA_ENGINEER; GRANT USAGE ON ALL SCHEMAS IN DATABASE RAW_DB TO ROLE DATA_ENGINEER; GRANT CREATE TABLE, CREATE VIEW, CREATE STREAM, CREATE TASK ON SCHEMA RAW_DB.INGESTION TO ROLE DATA_ENGINEER; GRANT CREATE TABLE, CREATE VIEW ON SCHEMA RAW_DB.STAGING TO ROLE DATA_ENGINEER; GRANT USAGE ON DATABASE ANALYTICS_DB TO ROLE DATA_ENGINEER; GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS_DB TO ROLE DATA_ENGINEER; GRANT CREATE TABLE, CREATE VIEW ON SCHEMA ANALYTICS_DB.MARTS TO ROLE DATA_ENGINEER; -- DATA_ANALYST and BI_DEVELOPER: read-only on analytics GRANT USAGE ON DATABASE ANALYTICS_DB TO ROLE DATA_ANALYST; GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS_DB TO ROLE DATA_ANALYST; GRANT SELECT ON ALL TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE DATA_ANALYST; GRANT SELECT ON ALL VIEWS IN SCHEMA ANALYTICS_DB.REPORTS TO ROLE DATA_ANALYST; GRANT USAGE ON DATABASE ANALYTICS_DB TO ROLE BI_DEVELOPER; GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS_DB TO ROLE BI_DEVELOPER; GRANT SELECT ON ALL TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE BI_DEVELOPER; GRANT SELECT ON ALL VIEWS IN SCHEMA ANALYTICS_DB.REPORTS TO ROLE BI_DEVELOPER; -- DATA_SCIENTIST: read on staged raw data and on analytics GRANT USAGE ON DATABASE RAW_DB TO ROLE DATA_SCIENTIST; GRANT USAGE ON ALL SCHEMAS IN DATABASE RAW_DB TO ROLE DATA_SCIENTIST; GRANT SELECT ON ALL TABLES IN SCHEMA RAW_DB.STAGING TO ROLE DATA_SCIENTIST; GRANT USAGE ON DATABASE ANALYTICS_DB TO ROLE DATA_SCIENTIST; GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS_DB TO ROLE DATA_SCIENTIST; GRANT SELECT ON ALL TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE DATA_SCIENTIST; -- APP_SERVICE_ACCOUNT: specific views only (replace with your application's views) GRANT USAGE ON DATABASE ANALYTICS_DB TO ROLE APP_SERVICE_ACCOUNT; GRANT USAGE ON SCHEMA ANALYTICS_DB.REPORTS TO ROLE APP_SERVICE_ACCOUNT; GRANT SELECT ON VIEW ANALYTICS_DB.REPORTS.ORDER_STATUS_V TO ROLE APP_SERVICE_ACCOUNT; -- ============================================ -- Step 6: Future grants (auto-apply to new objects) -- ============================================ GRANT SELECT ON FUTURE TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE DATA_ANALYST; GRANT SELECT ON FUTURE VIEWS IN SCHEMA ANALYTICS_DB.REPORTS TO ROLE DATA_ANALYST; GRANT SELECT ON FUTURE TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE BI_DEVELOPER; GRANT SELECT ON FUTURE VIEWS IN SCHEMA ANALYTICS_DB.REPORTS TO ROLE BI_DEVELOPER; GRANT SELECT ON FUTURE TABLES IN SCHEMA RAW_DB.STAGING TO ROLE DATA_SCIENTIST; GRANT SELECT ON FUTURE TABLES IN SCHEMA ANALYTICS_DB.MARTS TO ROLE DATA_SCIENTIST; -- ============================================ -- Step 7: Account-level privilege to run and resume tasks -- ============================================ USE ROLE ACCOUNTADMIN; GRANT EXECUTE TASK ON ACCOUNT TO ROLE DATA_ENGINEER; -- ============================================ -- Step 8: Service user and role assignments -- ============================================ USE ROLE USERADMIN; CREATE USER IF NOT EXISTS app_service_user TYPE = SERVICE DEFAULT_ROLE = APP_SERVICE_ACCOUNT DEFAULT_WAREHOUSE = APP_WH RSA_PUBLIC_KEY = '<public key>'; USE ROLE SECURITYADMIN; GRANT ROLE APP_SERVICE_ACCOUNT TO USER app_service_user; GRANT ROLE DATA_ENGINEER TO USER jane_engineer; GRANT ROLE DATA_ANALYST TO USER bob_analyst; GRANT ROLE DATA_SCIENTIST TO USER alice_ml;
Future Grants: Don't Skip This
Without future grants, every new table you create requires a manual GRANT before analysts can see it. In practice, this means someone creates a table, an analyst files a ticket, and 3 days later they can finally query it. Future grants fix this:
-- Every new table in MARTS is automatically SELECTable by analysts GRANT SELECT ON FUTURE TABLES IN SCHEMA analytics_db.marts TO ROLE DATA_ANALYST;
Future grants apply to objects created after the grant is set. They don't retroactively apply to existing objects. So run both GRANT SELECT ON ALL TABLES (for existing) and GRANT SELECT ON FUTURE TABLES (for new ones).
Database roles are another way to build this access layer. A database role is scoped to a single database and is granted to account roles, and it cannot be activated directly in a session. A common pattern is to create read and write database roles inside each database and grant them to the functional roles above, which keeps the grants for a database together with that database.
Managed Access Schemas
In a regular schema, whoever creates a table can grant access to it. This leads to sprawl: an engineer creates a staging table and grants SELECT to a random user, bypassing your role hierarchy entirely.
Managed access schemas fix this. In a managed access schema, only the schema owner, or a role with the MANAGE GRANTS privilege such as SECURITYADMIN, can grant privileges on the objects inside it:
CREATE SCHEMA analytics_db.secure_marts WITH MANAGED ACCESS; -- Now only the schema owner (the role that ran this CREATE), or a role -- with MANAGE GRANTS, can grant SELECT on tables in secure_marts. -- Table creators cannot grant access themselves.
Service Account Best Practices
Service accounts (for BI tools, applications, ETL orchestrators) need special attention:
- Create a dedicated role per service account. Don't reuse DATA_ANALYST for your Tableau service user.
- Grant SELECT only on specific views, not raw tables. Views let you control exactly which columns and rows the service can access.
- Attach a resource monitor to the service account's warehouse to prevent runaway queries from burning credits.
- Create service users with
TYPE = SERVICEand key-pair or OAuth authentication. Snowflake's 2026 MFA rollout blocks password sign-in for all non-human users, requires a second factor for human users who sign in with a password, and moves remaining LEGACY_SERVICE users to SERVICE. - Set a network policy to restrict the IP addresses the service account can connect from.
The ACCOUNTADMIN Ownership Gotcha
This trips up nearly every team at least once. If you're logged in as ACCOUNTADMIN and run CREATE DATABASE analytics_db, that database is owned by ACCOUNTADMIN. SYSADMIN can't see it, can't manage it, and can't grant access to it, even though SYSADMIN is meant to own all databases.
The fix: always switch to SYSADMIN before creating databases and schemas. If you've already created objects as ACCOUNTADMIN, transfer ownership:
GRANT OWNERSHIP ON DATABASE analytics_db TO ROLE SYSADMIN COPY CURRENT GRANTS;
Key Takeaways
- Reserve ACCOUNTADMIN for break-glass scenarios. Daily work should use functional roles under SYSADMIN.
- Create one role per team function (DATA_ENGINEER, DATA_ANALYST, etc.) and grant all custom roles to SYSADMIN.
- Use future grants on every schema to auto-apply permissions to new tables and views.
- Use managed access schemas to prevent table creators from granting ad-hoc access.
- Always create databases and warehouses as SYSADMIN, not ACCOUNTADMIN.
- Create service users with TYPE = SERVICE and key-pair authentication, and lock them down with dedicated roles, view-only access, resource monitors and network policies.
- New users activate all their granted roles as secondary roles by default. Set DEFAULT_SECONDARY_ROLES = () where each session should use one role.
Frequently Asked Questions
Q: Why shouldn't I use ACCOUNTADMIN for daily work in Snowflake?
ACCOUNTADMIN has unrestricted access to every object in the account. Using it daily violates least-privilege principles, increases the blast radius of mistakes, and makes audit trails meaningless since every action appears under the same all-powerful role.
Q: What are future grants in Snowflake?
Future grants automatically apply privileges to objects that don't exist yet. For example, GRANT SELECT ON FUTURE TABLES IN SCHEMA analytics TO ROLE DATA_ANALYST ensures every new table created in that schema automatically gets SELECT access for the DATA_ANALYST role.
Q: What is a managed access schema in Snowflake?
In a managed access schema, only the schema owner, or a role with the MANAGE GRANTS privilege, can grant privileges on objects within it. Individual table creators cannot grant access to their own tables, which centralises access control and prevents ad-hoc permission sprawl.
Q: What happens when I create a database as ACCOUNTADMIN?
The database is owned by ACCOUNTADMIN, not SYSADMIN. This means SYSADMIN cannot manage it or grant access to it. Best practice is to always create databases as SYSADMIN, or immediately transfer ownership after creation.
Related Articles
Still have questions?
Get AssistanceReady? Let's Talk!
Get expert insights and answers tailored to your business requirements and transformation.
Get Assistance