Grants a role to the specified logins, users, or system- or user-defined roles.
grant role role_name [where pred_expression] to {username | rolename | login_profile_name }
grant role doctor_role to mary
grant role intern_role to doctor_role
grant role nurse_role to john granted by roleAdmin
grant role ldap_user_role where get_appcontext(login_authentication) = 'LDAP' to login_profile lp_10
Using the above example, when the session of a user assigned login profile lp_10 enables ldap_user_role, the SAP ASE server checks that the session connected using LDAP. If there was an LDAP connection, the user assumes ldap_user_role; if not, ldap_user_role is not enabled. Configure the predicate evaluation to occur automatically during login by altering login profile lp_10 and specifying ldap_user_role on the auto activated roles attribute. Otherwise, the evaluation of the role activation predicate occurs when the user assigned lp_10 executes the set role statement.
The SAP ASE server automatically activates roles granted to logins or login profiles (after evaluating any predicate) when the user logs in if create login, alter login, create login profile, or alter login profile specify the role for automatic activation. Otherwise, the SAP ASE server activates the role when set role is executed. Adaptive automatically activates a role granted to another role when the dependent role is activated.
You can use the grant command to grant permissions to all users who have been granted a specified role. The role can be either a system role, like sso_role or sa_role, or a user-defined role. The system security officers must create the user-defined roles using a create role command.
The permission checks for grant role differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage roles privilege. |
Disabled | With granular permissions disabled, you must be a user with sso_role. To grant sa_role, you must be a user with sa_role. |
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 85 |
Audit option | roles |
Command or access audited | create role, drop role, alter role, grant role, or revoke role |
Information in extrainfo |
|