WVARCHAR(n)
auth_id(WVARCHAR(n) [[authorization]))
|
Returns an authentication
identifier as defined by the authentication provider, as a result
of passing input for user name.
|
WVARCHAR(n)
current_user()
|
Returns the name of
the current user. This is the FedSQL authorization identifier of the
currently authenticated user, rather than the login used.
|
|
|
Returns a user identifier
as defined by the authentication provider. Typically, this is a static
identifier by which the current user is known. Applications can associate
this identifier with an internal organization user identifier such
as an employee number or account number.
|
|
|
The name of the domain
in which the current user is authenticated.
|
WVARCHAR(n)
group_id(WVARCHAR(n) [[authorization])
|
Returns a group identifier
as defined by the authentication provider, as a result of passing
input for group name.
|
|
|
The login used to authenticate
the current user.
|
WVARCHAR(n)
userid( BITupn )
|
The domain qualified
user ID. If the upn parameter is TRUE, the format of the returned
user ID is user@domain. Otherwise, the format is domain\user on Windows
systems and just userid on all other systems. The userid function
returns the authenticated user ID as specified by the authentication
service. The authentication service can reside on a different host.
|
|
|
Returns the client IP
address of the current user’s session.
|
|
|
Returns TRUE or FALSE
if the current user is or is not an administrator.
|
|
|
Returns TRUE or FALSE
if the current user is, or is not the process user.
|
BIT member_of(
WVARCHAR(n) group [, WVARCHAR(n) options] )
|
Returns TRUE or FALSE
if the current user is, or is not a member of the specified group.
Can assert direct or indirect membership. The group parameter is a
group name by default and a group identifier if the ‘ID’
or 'DEEP' option is present in the options string. The options
string is a blank or comma separated string consisting of one or more
of ‘ID’ and ‘DEEP’ option keywords. The
current user must be a direct member of the specified group unless
the ‘DEEP’ keyword is specified. Direct membership is
tested by default.
|
TABLE(WVARCHAR(n)
group) groups( WVARCHAR(n) [[authorization] WVARCHAR(n) [, options]]
|
Returns a single group
name or identifier column result set containing the current user’s
group memberships. The available options are ‘ID’ or
‘DEEP’. Can be restricted to direct memberships only.
The authorization parameter is a user or group name by default and
a user or group identifier if the 'ID' option is present
in the options string. The options string is a blank or comma separated
string consisting of one or more of ‘ID’ and ‘DEEP’
option keywords. A deep group membership listing is returned if the
‘DEEP’ keyword is specified, the default being a shallow
listing.Note: A trusted user must be set in order for the GROUPS function
to return a result set if you pass in a user other than the current
user. If you pass in the current user or a group as the first argument
to GROUPS trusted user is not required.
|
Usage Notes for the
member_of and groups functions returning ‘ID’ or ‘DEEP’
member_of and groups functions:
SYSCAT.RLS.GROUPS(user_name_or_id [, options])
Lists the groups that
user_name_or_id is a member of.
SYSCAT.RLS.MEMBER_OF(group_name_or_id [, options])
Returns TRUE if the
current user is a member of the specified group_name_or_id group.
-
user_name_or_id: a string literal indicating the
user. If options contains ‘ID’
this will be treated as a user ID (for example, '6C6C9AD1E2646F0469DD6A3D1874D167').
Otherwise, this will be treated as a user name (for example, 'USER1').
-
group_name_or_id: a string literal indicating the
group. If options contains ‘ID’
this will be treated as a user ID (ex: '78319AD1E2646F0469DD6A3D1874A2F7'),
otherwise this will be treated as a user name (ex: 'GROUP1').
-
options: a string literal containing 'GROUP',
'ID', or both (ex: 'GROUP, ID'). If multiple options
are specified, they can be separated in the string by a blank '
' or comma ','. If options contains
'ID' the first argument is treated as an ID rather than
a name. If options contains ‘DEEP’
group membership will be checked recursively.
For example, consider
that USER1 is a member of GROUP1 and GROUP1 is a member of GROUP2.
USER1 runs the following queries:
Select SYSCAT.RLS.GROUP_ID('GROUP1') returns
'BEA892C6D4A40464C8A144D89FFE6463'
Select SYSCAT.RLS.GROUP_ID('GROUP2') returns
'45C562900C7333C49B1706B38DBA75B0'
Select SYSCAT.RLS.CURRENT_ID() returns
'5790EE3F6A24A7349AA2254600793411' for USER1
Select SYSCAT.RLS.MEMBER_OF('GROUP1') returns
Select SYSCAT.RLS.MEMBER_OF('GROUP2') returns
Select SYSCAT.RLS.MEMBER_OF('GROUP2', 'DEEP') returns
Select SYSCAT.RLS.MEMBER_OF('BEA892C6D4A40464C8A144D89FFE6463', 'ID') returns
Select SYSCAT.RLS.MEMBER_OF('45C562900C7333C49B1706B38DBA75B0', 'ID') returns
Select SYSCAT.RLS.MEMBER_OF('BEA892C6D4A40464C8A144D89FFE6463', 'DEEP, ID')
returns
The following queries
against GROUPS return a results set:
Select * from SYSCAT.RLS.GROUPS('USER1') returns
Select * from SYSCAT.RLS.GROUPS('USER1', 'DEEP') returns
"GROUP"
'USERS`
`GROUP1`
‘GROUP2’
`PUBLIC'