Check whether a function may be called
Syntax
canCall($call)
Description
Reports whether the currently logged-in user may make the given call of a configured TL-Script function, without making it. Only the arguments of the call are evaluated.
For a privileged script, the security object is computed and the command group is checked on it; for a collection of security objects, on every element. null and an empty collection deny the call. A plain configured function may always be called. Typical use: the executability of a command that calls a privileged function.
Parameters
| Name | Type | Type Description | Mandatory | Default |
|---|---|---|---|---|
| call | Function call | A call of a configured TL-Script function. Anything else is a compile error. | yes |
Return value
Type: Boolean
true if the current user may make the call, false otherwise.
Examples
Example 1
canCall(approveMilestone($milestone))
Output: Whether the logged-in user may call the function approveMilestone with the given milestone.