55.10 IS_ALLOWED Function

This function checks whether the given user is allowed to perform a certain operation on a Workflow.

Syntax

APEX_WORKFLOW.IS_ALLOWED (
    p_instance_id            IN NUMBER,
    p_operation              IN wwv_flow_workflow_api.t_workflow_operation,
    p_user                   IN VARCHAR2 DEFAULT wwv_flow_security.g_user )
RETURN BOOLEAN;

Parameters

Parameter Description
p_instance_id The Workflow ID.
p_operation The operation to check.
p_user The user to check for. Default is logged-in user.

Returns

TRUE if the user given by p_user is allowed to perform the operation given by p_operation. Otherwise FALSE.

Example

DECLARE
    l_is_allowed boolean;
BEGIN
    l_is_allowed := apex_workflow.is_allowed(
        p_instance_id     => 1234,
        p_operation       => apex_workflow.c_workflow_op_suspend,
        p_user            => 'STIGER'
    );
    IF l_is_allowed THEN
        dbms_output.put_line('STIGER is a allowed to suspend the workflow 1234');
    END IF;
END;