Skip to content

Grant Operations

Operation: grantRoles

pgm.grantRoles( roles_from, roles_to, grant_roles_options )

IMPORTANT

Define access privileges - postgres docs

Arguments

NameTypeDescription
roles_fromName or array[Name]Names of roles
roles_toName or array[Name]Names of roles
grant_roles_optionsobjectCheck below for available options

grant_roles_options

OptionTypeDefault
withAdminOptionbooleanfalse
onlyAdminOptionbooleanfalse
cascadebooleanfalse

Reverse Operation: revokeRoles

pgm.revokeRoles( roles, roles_from, drop_options )

IMPORTANT

Remove access privileges - postgres docs

Arguments

NameTypeDescription
rolesName or array[Name]Names of roles
roles_fromName or array[Name]Names of roles
drop_optionsobjectCheck below for available options

drop_options

OptionTypeDescription
onlyAdminOptionbooleandefault false
cascadebooleandrops also dependent objects

Operation: grantOnTables

pgm.grantOnTables( grant_options )

IMPORTANT

Define access privileges - postgres docs

Arguments

NameTypeDescription
grant_optionsobjectCheck below for available options

grant_options

OptionTypeDescription
tablesName or array[Name]Names of tables
schemastringif tables ALL, then schema name is required
privilegesarray[TablePrivileges] or ALLlist of privileges
rolesName or array[Name]names of roles
withGrantOptionbooleandefault false
cascadebooleandefault false

Reverse Operation: revokeOnTables

pgm.revokeOnTables( revoke_options )

IMPORTANT

Remove access privileges - postgres docs

Arguments

NameTypeDescription
revoke_optionsobjectCheck below for available options

revoke_options

OptionTypeDescription
tablesName or array[Name]Names of tables
schemastringif tables ALL, then schema name is required
privilegesarray[TablePrivileges] or ALLlist of privileges
rolesName or array[Name]names of roles
withGrantOptionbooleandefault false
cascadebooleandrops also dependent objects

Operation: grantOnSchemas

pgm.grantOnSchemas( grant_options )

IMPORTANT

Define access privileges - postgres docs

Arguments

NameTypeDescription
grant_optionsobjectCheck below for available options

grant_options

OptionTypeDescription
schemasName or array[Name]Names of schemas
privilegesarray[SchemaPrivileges] or ALLlist of privileges
rolesName or array[Name]names of roles
withGrantOptionbooleandefault false
onlyGrantOptionbooleandefault false
cascadebooleandefault false

Reverse Operation: revokeOnSchemas

pgm.revokeOnSchemas( revoke_options )

IMPORTANT

Remove access privileges - postgres docs

Arguments

NameTypeDescription
revoke_optionsobjectCheck below for available options

revoke_options

OptionTypeDescription
schemasName or array[Name]Names of schemas
privilegesarray[SchemaPrivileges] or ALLlist of privileges
rolesName or array[Name]names of roles
withGrantOptionbooleandefault false
onlyGrantOptionbooleandefault false
cascadebooleandrops also dependent objects