Oracle APEX: Built-in User Group Variable

1.5k Views Asked by At

I was wondering if there is a variable like :APP_USER, but instead of the username it should return the user group, so I can check if the current user is administrator.

2

There are 2 best solutions below

1
On BEST ANSWER

The APEX_UTIL package contains some functions that can be useful for this too:

CURRENT_USER_IN_GROUP This function returns a Boolean result based on whether the current user is a member of the specified group. You can use the group name or group ID to identify the group.

GET_GROUPS_USER_BELONGS_TO This function returns a comma then a space separated list of group names to which the named user is a member.

0
On

I found the solution myself:

SELECT group_name
FROM   wwv_flow_group_users
WHERE  user_id = (SELECT   user_id
                  FROM     wwv_flow_users
                  WHERE    user_name ='MRITTMAN')

This lists all group names the user "MRITTMAN" is assigned to.