4.2 IS_AUTHORIZED Function

Determine if the current user passes the authorization with name p_authorization_name. For performance reasons, authorization results are cached. Because of this, the function may not always evaluate the authorization when called, but take the result out of the cache.

See Also:

"Changing the Evaluation Point Attribute" in Oracle Application Express App Builder User’s Guide

Syntax

APEX_AUTHORIZATION.IS_AUTHORIZED (
    p_authorization_name IN VARCHAR2 )
    RETURN BOOLEAN;

Parameters

Table 4-2 IS_AUTHORIZED Function Parameters

Parameter Description

p_authorization_name

The name of an authorization scheme in the application.

Returns

Table 4-3 IS_AUTHORIZED Function Returns

Parameter Description

TRUE

If the authorization is successful.

FALSE

If the authorization is not successful.

Example

This example prints the result of the authorization "User Is Admin".

begin
    sys.htp.p('User Is Admin: '||
              case apex_authorization.is_authorized (
                       p_authorization_name => 'User Is Admin' )
              when true then 'YES'
              when false then 'NO'
              else 'null'
              end);
end;