workflow::case::action::available_p (public)

 workflow::case::action::available_p \
    [ -enabled_action_id enabled_action_id ] [ -case_id case_id ] \
    [ -action_id action_id ] [ -user_id user_id ]

Defined in packages/workflow/tcl/case-procs.tcl

Is this action currently enabled and does the user have permission to perform it?

Switches:
-enabled_action_id
(optional)
The enabled action you want to test for permission on.
-case_id
(optional)
Deprecated. The ID of the case.
-action_id
(optional)
Deprecated. The ID of the action
-user_id
(optional)
The user.
Returns:
true or false.
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bug-tracker/www/bug.tcl packages/bug-tracker/ www/bug.tcl workflow::case::action::available_p workflow::case::action::available_p packages/bug-tracker/www/bug.tcl->workflow::case::action::available_p packages/bug-tracker/www/bulk-update-op.tcl packages/bug-tracker/ www/bulk-update-op.tcl packages/bug-tracker/www/bulk-update-op.tcl->workflow::case::action::available_p workflow::case::action::enabled_p workflow::case::action::enabled_p (public) workflow::case::action::available_p->workflow::case::action::enabled_p workflow::case::action::get_enabled_action_id workflow::case::action::get_enabled_action_id (private) workflow::case::action::available_p->workflow::case::action::get_enabled_action_id workflow::case::action::permission_p workflow::case::action::permission_p (public) workflow::case::action::available_p->workflow::case::action::permission_p workflow::case::enabled_action_get workflow::case::enabled_action_get (public) workflow::case::action::available_p->workflow::case::enabled_action_get

Testcases:
No testcase defined.
Source code:
    # Always permit the no-op
    if { $action_id eq "" && $enabled_action_id eq "" } {
        return 1
    }

    if { $enabled_action_id ne "" } {
        workflow::case::enabled_action_get -enabled_action_id $enabled_action_id -array enabled_action
        set case_id $enabled_action(case_id)
        set action_id $enabled_action(action_id)
    } else {
        set enabled_action_id [workflow::case::action::get_enabled_action_id  -any_parent  -case_id $case_id  -action_id $action_id]
    }

    if { [workflow::case::action::enabled_p -case_id $case_id -action_id $action_id] &&
         [workflow::case::action::permission_p -enabled_action_id $enabled_action_id -user_id $user_id] } {
        return 1
    } else {
        return 0
    }
Generic XQL file:
packages/workflow/tcl/case-procs.xql

PostgreSQL XQL file:
packages/workflow/tcl/case-procs-postgresql.xql

Oracle XQL file:
packages/workflow/tcl/case-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: