Updated on 2026-11-06 GMT+08:00

Role Management

Aura uses a typical role-based access control (RBAC) model to manage users, roles, and permissions.

A role is a set of permissions.

  • Roles are assigned different permissions based on their responsibilities in the database system. A role is a set of database permissions and represents the behavior constraints of a user or user group.
  • After a role is assigned to a user through GRANT, the user will have all the permissions of the role. Roles are recommended for efficient permissions assignment. For example, you can create different roles for designers, developers, and maintainers, assign the roles to users through GRANT, and grant specific data permissions to the users. When permissions are granted to or revoked from roles, the changes apply to all members of the roles.

Querying Roles

SELECT * FROM pg_show_roles();

Managing Roles

  • Create a role.
    CREATE ROLE role_name [ COMMENT 'comment_text' ];
  • Delete a role.
    DROP ROLE [ IF EXISTS ] role_name;
  • Modify a role.
    ALTER ROLE role_name COMMENT 'modify COMMENT';
  • Associate a role with users.
    • Change the role associated with a user.
      ALTER USER user1 WITH ROLE role1;
    • Change the users associated with a role.
      ALTER ROLE role1 ADD USER user1;
  • Associate a role with user groups.
    • Change the role associated with a user group.
      ALTER USER GROUP group1 WITH ROLE role1;
    • Change the user groups associated with a role.
      ALTER ROLE role1 ADD USER GROUP group1; 
  • Associate a role with an agency.
    ALTER ROLE role1 ADD AGENT agent1;
  • Remove association.
    • Disassociate a user with a role.
      ALTER ROLE role1 DROP USER user1;
    • Disassociate a user group with a role.
      ALTER ROLE role1 DROP USER GROUP group1;
    • Disassociate an agency with a role.
      ALTER ROLE role1 DROP AGENT agent1;