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) » Tutorial: Granting roles and privileges (SQL)

 

Lesson 4: Convert UserA to a user-extended role and grant that role to UserB (SQL)

Assume that you want UserB to have the same privileges and roles as UserA. Rather than going through the same lengthy process of granting the same roles and privileges you granted UserA to UserB, you can convert UserA to a user-extended role and then grant that role to UserB. UserA continues to be a user who can log in to the database, in addition to being a role.

Prérequis

This lesson assumes that you have completed all previous lessons in this tutorial. See Lesson 3: Create a role and grant it to UserA (SQL).

 Task
  1. In Interactive SQL, convert UserA to a user-extended role by executing the following statement:

    CREATE ROLE FOR USER UserA;
  2. Grant the user-extended role UserA to UserB by executing the following statement:

    GRANT ROLE UserA TO UserB;

    This gives UserB the ability to exercise the UserA role. That is, any roles and privileges that UserA can exercise, UserB can exercise as well.

Résultat

UserA has been converted to a user-extended role and has been granted to UserB.

 See also