Skip to main content

CREATE ROLE (bSQL) | Blockpoint Docs

Creates a new database role in the current database. For examples, see Examples

bSQL Syntax Conventions

Syntax

CREATE ROLE role_name [ AUTHORIZATION owner_name ]  

Arguments

role_name
Is the name of the role to be created.

AUTHORIZATION owner_name
Is the database user or role that is to own the new role. If a user isn't specified, the role will be owned by the user that executes CREATE ROLE. The owner of the role, or any member of an owning role can add or remove members.

Permissions

Requires AUTH permissions on the target blockchain.

AUTH permissions default to members of the admin database roles. Members of the admin fixed database role can transfer permissions to other users.

Remarks

Roles are database-level securables. After you create a role, configure the database-level permissions of the role by using GRANT and REVOKE. To add members to a database role, use ALTER ROLE. For more information on permissions, see Database-Level Roles.

Examples

The following examples uses the Financial Demo Database.

A. Creating a database role that is owned by a database user.

The following example creates the database role buyers that is owned by user ben_miller.

CREATE ROLE buyers AUTHORIZATION ben_miller

B. Creating a database role that is owned by a fixed database role.

The following example creates the database role management that is owned the admin fixed database role.

CREATE ROLE management AUTHORIZATION admin

See Also