11.2 HAS_ACCESS Function

This function determines if the current user passes the authorization Static ID. 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.

Syntax

APEX_AUTHORIZATION.HAS_ACCESS (
    p_static_id  IN   VARCHAR2 )
RETURN BOOLEAN;

Parameters

Parameter Description
p_static_id The Static ID of an authorization scheme in the application.

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 Static ID "user-admin"

begin
    sys.htp.p('User Is Admin: '||
        case apex_authorization.has_access (
            p_static_id =>'user-admin')
        when true then 'YES'
        when false then 'NO'
        else 'null'
        end);
end;