Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.
Action availability defines whether the action is permitted on the selected item. For example, the addCategory action below is permitted when:
Magnolia 5.3+: Starting with Magnolia 5.3 you can add multiple availability rule classes. See the example below. The rules
parent node contains subnodes, one for each rule. The rules are combined with a logical AND operator. Each rule must have the implementationClass
property which points directly to the rule class (no more definition class).
Node name | Value |
---|---|
actions |
|
addCategory |
|
availability |
|
nodeTypes | |
category | mgnl:category |
folder | mgnl:folder |
root | true |
rules |
|
notDeletedRule | |
implementationClass | info.magnolia.ui.api.availability.IsNotDeletedRule |
anotherRule | |
implementationClass | com.your.customapp.app.action.availability.AnotherAvailabilityRule |
Properties
availability
access
: Action is available if the current user has one of the listed roles.roles
<role>
: Name of the role that is permitted to execute the action.nodes
: Action is available if the selected item is a node. nodeTypes
:
Action is available if the selected item is one of the node types listed.<node type>
: A valid node type such as mgnl:folder
. rules:
Action is available if the selected item(s) match for every availability rule class <ruleNodeName>
: give the node a name which reflects the rule-class implementationClass
: the class name of the rule availability class; class must implement info.magnolia.ui.api.availability.AvailabilityRule
(usually just extending info.magnolia.ui.api.availability.AbstractAvailabilityRule
)root
: Action is available at the workspace root level if true.properties
: Action is available if the selected item is a property.multiple
: Boolean property that enables and disables multiselection. Default is false
. Available when the action class extends writePermissionRequired
: Optional. Set to true
if the action requires write permission on the currently selected node. The action will be disabled if the user doesn't have write permission. Default is false
. Magnolia 5.2.x and earlier:
Node name | Value |
---|---|
actions |
|
addCategory |
|
availability |
|
nodeTypes |
|
category | mgnl:category |
folder | mgnl:folder |
root | true |
ruleClass | info.magnolia.ui.api.availability.IsNotDeletedRule |
Properties
availability
access
: Action is available if the current user has one of the listed roles.roles
<role>
: Name of the role that is permitted to execute the action.nodes
: Action is available if the selected item is a node. nodeTypes
:
Action is available if the selected item is one of the node types listed.<node type>
: A valid node type such as mgnl:folder
.ruleClass
: Class that contains custom logic to check if the action is permitted on the selected item. A common example is info.magnolia.ui.api.availability.IsNotDeletedRule
which checks that the item is not marked for deletion. Your custom class must extend root
: Action is available at the workspace root level if true.properties
: Action is available if the selected item is a property.multiple
: Boolean property that enables and disables multiselection. Default is false
. Available when the action class extends Action availability is different from action bar section availability. Section availability defines whether the actions configured within a section are displayed in the action bar. If the section is displayed, then action availability is checked for each action in the section.