GRANT SET USER Statement

Grants the ability for one user to impersonate another user and to administer the SET USER system privilege.

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

GRANT SET USER ( target_users_list 
      | ANY 
      | ANY WITH ROLES target_roles_list )
  TO userID [,...] 
  [ WITH ADMIN [ ONLY ] OPTION | WITH NO ADMIN OPTION ]

Parameters

(back to top)

Examples

(back to top)

Usage

(back to top)

A user can be granted the ability to impersonate any user in the database (ANY) or only specific users (target_users_list) or members of specific roles (ANY WITH ROLES target_roles_list). Administrative rights to the SET USER system privilege can only be granted when using the ANY clause.

If no clause is specified, ANY is used by default. If no administrative clause is specified in the grant statement, the WITH NO ADMIN OPTION clause is used.

If regranting the SET USER system privilege to a user, the effect of the regrant is cumulative.

By default, the SET USER system privilege is granted to the SYS_AUTH_SSO_ROLE compatibility role with the WITH NO ADMIN OPTION clause, if they exist.

The granting of the SET USER system privilege to a user only grants the potential to impersonate another user. Validation of the at-least criteria required to successfully impersonate another user does no occur until the SETUSER statement is issued.

Standards

(back to top)

ANSI SQL–Compliance level: Transact-SQL extension.

Permissions

(back to top)

Related reference
REVOKE SET USER Statement