pub enum RoleAttribute {
Show 22 variants
SuperUser,
NoSuperUser,
CreateDb,
NoCreateDb,
CreateRole,
NoCreateRole,
Inherit,
NoInherit,
Login,
NoLogin,
Replication,
NoReplication,
BypassRls,
NoBypassRls,
ConnectionLimit(i32),
Password(String),
EncryptedPassword(String),
UnencryptedPassword(String),
ValidUntil(String),
InRole(Vec<String>),
Role(Vec<String>),
Admin(Vec<String>),
}Expand description
PostgreSQL role attribute specifications
These attributes control various privileges and settings for database roles. They are used in CREATE ROLE, ALTER ROLE, and CREATE USER statements.
§Privilege Attributes
`SuperUser`/`NoSuperUser`- Superuser privilege`CreateDb`/`NoCreateDb`- Database creation privilege`CreateRole`/`NoCreateRole`- Role creation privilege`Inherit`/`NoInherit`- Privilege inheritance`Login`/`NoLogin`- Login capability`Replication`/`NoReplication`- Replication privilege`BypassRls`/`NoBypassRls`- Row-level security bypass
§Configuration Attributes
`ConnectionLimit`- Maximum concurrent connections (-1 = unlimited)`Password`- Set role password (automatically encrypted)`EncryptedPassword`- Set pre-encrypted password`UnencryptedPassword`- Set unencrypted password (not recommended)`ValidUntil`- Password expiration timestamp
§Role Membership Attributes
`InRole`- Add role to specified roles`Role`- Grant specified roles to this role`Admin`- Grant specified roles with ADMIN OPTION
Variants§
SuperUser
SUPERUSER privilege - can override all access restrictions
NoSuperUser
NOSUPERUSER - explicitly deny superuser privilege
CreateDb
CREATEDB privilege - can create databases
NoCreateDb
NOCREATEDB - cannot create databases
CreateRole
CREATEROLE privilege - can create roles
NoCreateRole
NOCREATEROLE - cannot create roles
Inherit
INHERIT - automatically inherit privileges of roles it is a member of
NoInherit
NOINHERIT - do not automatically inherit privileges
Login
LOGIN - role can log in (required for users)
NoLogin
NOLOGIN - role cannot log in (typical for group roles)
Replication
REPLICATION - role can initiate streaming replication
NoReplication
NOREPLICATION - role cannot initiate replication
BypassRls
BYPASSRLS - role bypasses row-level security policies
NoBypassRls
NOBYPASSRLS - role is subject to row-level security
ConnectionLimit(i32)
CONNECTION LIMIT - maximum concurrent connections (-1 = unlimited)
Password(String)
PASSWORD - set role password (will be encrypted by PostgreSQL)
EncryptedPassword(String)
ENCRYPTED PASSWORD - set pre-encrypted password
UnencryptedPassword(String)
UNENCRYPTED PASSWORD - set unencrypted password (deprecated, not recommended)
ValidUntil(String)
VALID UNTIL - password expiration timestamp (ISO 8601 format recommended)
InRole(Vec<String>)
IN ROLE - add this role to the specified roles
Role(Vec<String>)
ROLE - grant the specified roles to this role
Admin(Vec<String>)
ADMIN - grant the specified roles with ADMIN OPTION
Trait Implementations§
Source§impl Clone for RoleAttribute
impl Clone for RoleAttribute
Source§fn clone(&self) -> RoleAttribute
fn clone(&self) -> RoleAttribute
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more