Database Privilege and Access Control
Database privilege and access control is the part of a database that decides which identity may connect, which data or administrative objects it may use, and which operations it may perform. Accounts, roles, grants, ownership, and row policies turn an organization’s access rules into checks the database enforces.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Database Privilege and Access Control
Database privilege and access control is the database's internal bouncer. It does not decide whether a password or token is genuine; that is authentication's job. It decides whether the resulting database identity may carry out this particular operation on this particular object. The distinction is less glamorous than a spy film and considerably more useful when a login succeeds but a query does not.
The machinery has a pleasingly bureaucratic shape. A principal is the person, service, or workload that connects. A role packages access around a responsibility. A privilege names an allowed operation and its scope. The database combines direct grants, role memberships, ownership, public defaults, and policies into effective access. This is why one neat-looking role does not settle the matter. Access can arrive by a side door wearing a perfectly respectable badge.
Scope is the part that keeps a small request from becoming a large mistake. Reading three tables calls for a narrow read role, not global read access or ownership. A migration process needs authority to create objects in one schema, not the keys to account management. Ownership deserves its own wary glance because owners can often alter, drop, or pass access onward. Grant and admin options are similarly not decorative ribbons; they decide who may redraw the access map.
Row-level security adds a second gate after broad table access. A principal can have permission to read a table yet see only rows accepted by a policy. That is useful when one table serves separate tenants or departments. It also explains a familiar small mystery: a query can run without error and still return no rows. Owners and administrators may bypass ordinary policies, so testing only with a powerful account is a fine way to certify the wrong thing.
Views and routines have their own trick. Invoker rights use the caller's authority. Definer rights use authority tied to the stored object. The latter can expose one narrow operation without revealing the base tables, but it becomes an escalation path when the owner has excess authority or the code accepts unsafe input. Databases are admirably literal about this; they do exactly what the authority path says, including the bits nobody meant to draw.
Start with the Introduction for the complete authorization flow and the vocabulary. Use the Slides when you need the access graph, scope ladder, and second gate in one view. Keep the Cheatsheet nearby when diagnosing a denial or reviewing ownership, delegation, and future-object drift. The practice material then turns the model into a local PostgreSQL test: grant the narrow path, test a permitted read, and test the neighboring operation that must remain forbidden.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
Supports
- Least privilege, account management, separation of duties, and access enforcement
- Review and removal of assigned authorizations
- https://www.postgresql.org/docs/current/user-manag.html
Supports
- Database principals, login roles, group roles, membership, inheritance, and role attributes
- https://www.postgresql.org/docs/current/ddl-priv.html
Supports
- Object ownership, object privilege types, PUBLIC defaults, grant options, revocation, and privilege displays
- https://www.postgresql.org/docs/current/sql-grant.html
Supports
- Object grants, role membership grants, grant option, admin option, and SQL-standard differences
- https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html
Supports
- Privileges for future objects and their dependency on the creating role and schema
- https://www.postgresql.org/docs/current/ddl-rowsecurity.html
Supports
- Row policy evaluation, default-deny behavior, command-specific policies, policy composition, and bypass rules
- https://www.postgresql.org/docs/current/sql-createview.html
Supports
- Security-invoker and security-barrier view behavior
- https://www.postgresql.org/docs/current/sql-createfunction.html
Supports
- Security-definer and security-invoker function behavior and safe security-definer configuration
- https://dev.mysql.com/doc/refman/8.0/en/access-control.html
Supports
- Separation of connection verification from request verification, account identity, grant tables, and privilege-change timing
- https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html
Supports
- Administrative, database, table, column, routine, static, and dynamic privilege scopes
- https://dev.mysql.com/doc/refman/8.4/en/roles.html
Supports
- Named privilege collections, role grants, activation, default roles, and role inspection
- https://dev.mysql.com/doc/refman/9.1/en/grant.html
Supports
- Separate object-privilege and role grants, grant authority, and admin option
- https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/getting-started-with-database-engine-permissions
Supports
- Security principals, server and database roles, permission hierarchy, least permission, monitoring, and examples
- https://learn.microsoft.com/en-us/sql/relational-databases/security/permissions-hierarchy-database-engine
Supports
- SQL Server securable and permission hierarchy
- https://learn.microsoft.com/en-us/sql/relational-databases/security/row-level-security
Supports
- Database-tier row filtering based on group membership or execution context
- https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/user-roles.html
Supports
- Enabled and nested roles, PUBLIC, security domains, and definer versus invoker rights
- https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/granting-and-revoking-roles1.html
Supports
- Role grants, nested roles, selective activation, and grant authority
- https://www.mongodb.com/docs/current/core/authorization/
Supports
- Role-based authorization, privileges on resources and actions, inherited roles, and additive access
- https://mariadb.com/docs/server/security/user-account-management/roles/roles_overview
Supports
- Role creation, assignment, activation, nesting, and definer behavior
- https://mariadb.com/docs/server/reference/sql-statements/account-management-sql-statements/grant
Supports
- Global, database, table, column, and routine privilege levels plus grant and admin options
- https://docs.snowflake.com/en/user-guide/security-access-control-overview
Supports
- DAC, RBAC, UBAC, securables, account and database roles, role hierarchy, ownership, and managed access schemas
- https://docs.snowflake.com/en/user-guide/security-access-control-considerations
Supports
- Custom-role and least-privilege access-control guidance
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/database-authentication.html
Supports
- Password, IAM, and Kerberos database authentication and minimally privileged application users
- https://github.com/sindresorhus/awesome
Supports
- Required Awesome-list starting point and route to the Database Tools list
- https://github.com/mgramin/awesome-db-tools
Supports
- Discovery of Acra, Databunker, and Inspektor in the database security section
- https://docs.cossacklabs.com/acra/
Supports
- Acra database proxy and application-level protection architecture
- https://github.com/inspektor-dev/inspektor
Supports
- Protocol-aware database proxy and contextual Open Policy Agent authorization
- https://docs.databunker.org/oss/get-started/overview
Supports
- Secure personal-record vault, token references, restricted retrieval, and API access model
- https://www.postgresql.org/about/news/postgresql-810-officially-released-422/
Supports
- November 2005 PostgreSQL 8.1 release and introduction of database roles
- https://www.postgresql.org/docs/9.0/release-9-0.html
Supports
- September 2010 mass schema grants and default privileges for future objects
- https://www.postgresql.org/docs/9.5/release-9-5.html
Supports
- January 2016 PostgreSQL row-level security milestone
- https://www.microsoft.com/en-us/sql-server/blog/2016/06/01/sql-server-2016-is-generally-available-today/
Supports
- June 2016 SQL Server release and database-engine row-level security milestone
- https://www.postgresql.org/docs/10/release-10.html
Supports
- October 2017 predefined monitoring roles milestone
- https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html
Supports
- April 2018 MySQL 8.0 general availability and production role-management behavior
- https://www.postgresql.org/docs/15/release-15.html
Supports
- October 2022 security-invoker views and granular configuration privileges
- https://www.postgresql.org/docs/16/release-16.html
Supports
- September 2023 granular role-membership options, grantor tracking, and role-management changes
- https://www.postgresql.org/
Supports
- PostgreSQL Landscape identity and product destination
- https://www.mysql.com/
Supports
- MySQL Landscape identity and product destination
- https://mariadb.com/products/community-server/
Supports
- MariaDB Server Landscape identity and product destination
- https://www.microsoft.com/en-us/sql-server/
Supports
- Microsoft SQL Server Landscape identity and product destination
- https://www.oracle.com/database/
Supports
- Oracle Database Landscape identity and product destination
- https://www.mongodb.com/products/self-managed/community-edition
Supports
- MongoDB Landscape identity and product destination
- https://www.snowflake.com/en/product/platform/
Supports
- Snowflake Landscape identity and product destination
- https://aws.amazon.com/rds/
Supports
- Amazon RDS Landscape identity and product destination
- https://brtkwr.com/posts/2026-06-01-transferring-postgres-database-ownership/
Supports
- Practitioner account of ownership migration, residual grants and inherited membership creating independent access paths
- Use of lower environments and catalog dependency checks during ownership changes
