Access Control Functions
Reference for the GridGain 9 access control SQL functions — creating and managing users, roles, privileges, and row-level security policies.
This section walks you through the access control functions supported by GridGain 9.
CREATE USER
Creates a new user. You must specify user password. Newly created users do not have any permissions. To grant them, assign the user the role by using the GRANT command, and make sure the role has correct privileges.
CREATE USER [IF NOT EXISTS] user_name IDENTIFIED WITH auth_type BY passParameters:
user_name- the name of the user.auth_type- type of authentication for the user. Onlyplain_passwordis available.pass- user password.
Examples:
CREATE USER IF NOT EXISTS user1 IDENTIFIED WITH plain_password BY 'user1pass';
CREATE USER user2 IDENTIFIED WITH plain_password BY 'user2pass';SHOW USER
Shows user information, including granted roles and authentication type.
SHOW USER user_nameParameters:
user_name- the name of the user.
Examples:
SHOW USERS
Lists all users created on the cluster.
Examples:
ALTER USER
Changes the password of an existing user. Requires the EDIT_USER privilege on the target user. Existing connections continue to use the credentials they were opened with, but any new connection must use the new password.
Parameters:
user_name- the name of the user.pass- new user password.
Examples:
DROP USER
Deletes the specified user.
Parameters:
user_name- the name of the user.
Examples:
CREATE ROLE
Creates a new role. For the role to have any permissions, use the GRANT command to assign them.
Parameters:
role_name- the name of the role.
Examples:
SHOW ROLE
Shows the role and permissions assigned to it.
Parameters:
role_name- the name of the role.
Examples:
SHOW ROLES
Lists all roles created on the cluster.
Examples:
DROP ROLE
Deletes the specified role.
Parameters:
role_name- the name of the role.
Examples:
GRANT
Assigns privileges to roles.
GRANT TO role
Parameters:
privileges- the names of the privileges to grant to a role.role_names- the names of the roles to grant the privileges to.
Examples:
GRANT TO user
Assigns roles to users.
Parameters:
role_names- the names of the roles to be assigned to users.user_names- the names of the users to grant the roles to.
Examples:
REVOKE
REVOKE FROM role
Revokes privileges from roles.
Parameters:
privileges- the names of the privileges to be revoked.role_names- the name of the roles to revoke the privileges from.
Examples:
Revokes the CREATE_TABLE role from
REVOKE FROM user
Revokes roles from users.
Parameters:
role_names- the names of the roles to revoke.user_name- the names of the users to revoke the roles from.
Examples:
SHOW GRANTS
Lists all privileges granted to the specified user or role.
Parameters:
user_name- the name of the user.role- the name of the role.
Examples:
CREATE POLICY
Creates a row-level security policy on a table. The policy grants the listed roles visibility of the rows for which the USING expression evaluates to TRUE. The policy is created in the schema of the target table, and its name must be unique within that schema. For a conceptual overview, see Row-Level Security.
Parameters:
policy_name- the name of the policy. Must be a simple (non-qualified) name.table_name- the name of the table the policy protects. May be schema-qualified.role_names- a comma-separated list of role names the policy applies to. If theTOclause is omitted, orEVERYONEis specified, the policy applies to all roles.expression- a boolean SQL predicate expression over the columns of the target table. The following restrictions apply:The expression must evaluate to the
BOOLEANtype.Only columns that exist in the target table may be referenced.
The following temporal SQL functions are not supported:
LOCALTIME,LOCALTIMESTAMP,CURRENT_DATE.
Examples:
ALTER POLICY
Changes the roles and/or the predicate of an existing policy. At least one of the TO and USING clauses must be specified; only the clauses you provide are changed.
Parameters:
policy_name- the name of the policy. May be schema-qualified.role_names- a comma-separated list of role names that the policy applies to. SpecifyEVERYONEto apply it to all roles.expression- the new boolean SQL predicate evaluated for each row. The same rules and restrictions apply as for theUSINGexpression of CREATE POLICY.
Examples:
DROP POLICY
Removes a row-level security policy. If the dropped policy was the only one granting a user access, that user will no longer see any rows while row-level security remains enabled on the table.
Parameters:
policy_name- the name of the policy to drop. May be schema-qualified. NoON table_nameclause is used.
Examples:
Grammar Reference
link_privileges
Parameters:
actions- the names of the actions to grant or revoke.object_name- the object the actions apply to.Use a single name (for example,
PUBLIC) to target a schema, which covers all current and future objects in that schema.Use a schema-qualified name (for example,
PUBLIC.MY_TABLE) to target a single object.
Referenced by:
link_identifier_list
Parameters:
name- the name of an entity on the list.
Referenced by:
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

