FirebirdSQL logo

RDB$ROLE_IN_USE()

Checks if a role is active for the current connection

Result type

BOOLEAN

Syntax
RDB$ROLE_IN_USE (role_name)
Table 1. RDB$ROLE_IN_USE Function Parameters
Parameter Description

role_name

String expression for the role to check.Case-sensitive, must match the role name as stored in RDB$ROLES

RDB$ROLE_IN_USE returns TRUE if the specified role is active for the current connection, and FALSE otherwise.Contrary to CURRENT_ROLE — which only returns the explicitly specified role — this function can be used to check for roles that are active by default, or cumulative roles activated by an explicitly specified role.

RDB$ROLE_IN_USE Examples

List currently active roles
select rdb$role_name
from rdb$roles
where rdb$role_in_use(rdb$role_name);
See also

CURRENT_ROLE

RDB$SYSTEM_PRIVILEGE()

Checks if the authorization of the current connection has a system privilege

Result type

BOOLEAN

Syntax
RDB$SYSTEM_PRIVILEGE (<sys_privilege>)

<sys_privilege> ::=
  !! See CREATE ROLE !!
Table 1. RDB$SYSTEM_PRIVILEGE Function Parameters
Parameter Description

sys_privilege

System privilege

RDB$SYSTEM_PRIVILEGE accepts a system privilege name and returns TRUE if the current connection has the given system privilege, and FALSE otherwise.

The authorization of the current connection is determined by privileges of the current user, the user PUBLIC, and the currently active roles (explicitly set or activated by default).

RDB$SYSTEM_PRIVILEGE Examples

select rdb$system_privilege(user_management) from rdb$database;