2.9 REPLACE_USER_ROLES Procedure Signature 2

This procedure replaces any existing assigned user roles to new array of roles.

Syntax

APEX_ACL.REPLACE_USER_ROLES (
    p_application_id  IN NUMBER   default apex_application.g_flow_id,
    p_user_name       IN VARCHAR2,
    p_role_static_ids IN apex_t_varchar2 );

Parameters

Table 2-9 REPLACE_USER_ROLES Procedure Signature 2 Parameters

Parameter Description

p_application_id

The application ID for which you want to replace user role. Defaults to the current application.

p_user_name

The case insensitive name of the application user to replace the role.

p_role_static_ids

The array of case insensitive VARCHAR2 type of role static IDs.

Example

The following example shows how to use REPLACE_USER_ROLES procedure to replace existing roles to new role static IDs of 'ADMINISTRATOR' and 'CONTRIBUTOR' for the user name called 'SCOTT' in application 255.

begin
    APEX_ACL.REPLACE_USER_ROLES (
        p_application_id  => 255,
        p_user_name       => 'SCOTT',
        p_role_static_ids => apex_t_varchar2( 'ADMINISTRATOR', 'CONTRIBUTOR' ) );
end;