Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » User and database security » User security (roles and privileges) » Roles » User-defined roles

 

Creating a user-defined role (SQL)

Create a role and grant privileges and roles to it.

Prérequis

You must have the MANAGE ROLES system privilege.

The name you assign to the new role cannot begin with the prefix SYS_ and end with the suffix _ROLE. For example, SYS_MyBackup_ROLE cannot be the name of a user-defined role.

Contexte et remarques

You can also convert an existing user into a user-extended role, and then grant the user-extended role to other users.

 Task
  1. Connect to the database.

  2. Execute a CREATE ROLE statement. For example:

    CREATE ROLE role-name
  3. Grant system privileges and roles to the new role using the GRANT statement.

Résultat

The new role is created.

Suivant

Grant system privileges to this role and grant this role to other users.

Exemple

The following statement creates a role called Sales. Because no administrator was specified, global administrators (users with the MANAGE ROLES system privilege) can administrator the role.

CREATE ROLE Sales;
GRANT SELECT, UPDATE ON GROUPO.SalesOrders TO Sales;
GRANT SELECT, UPDATE ON GROUPO.SalesOrderItems TO Sales;

 See also