Action bar availability defines whether a particular section of the action bar is available. If the section is available, then action availability is checked.

For example, in the action bar configuration in the Contacts app:

  • Actions in the root section display on the root node only. The user sees the Add contact, Add folder and Import actions defined in the groups in the root section.
  • Actions in the contact section display on selection of a mgnl:contact node type.
  • Actions in the deletedContact section display on selection of a mgnl:contact node type, but the IsDeletedRule rule class limits action availability when a contact has been marked for deletion to the Publish deletion and Restore previous version actions. This rule returns true if the item is a node and has the mgnl:deleted mixin type.
Node nameValue

 
actionbar

 

 
sections

 

 
root

 

 
groups

 

 
availability

 

 
nodes

false

 
root

true

 
deletedContact

 

 
groups

 

 
availability

 

 
nodeTypes

 

 
contact

mgnl:contact

 
ruleClass

info.magnolia.ui.api.availability.IsDeletedRule

 
deletedFolder

 

 
contact

 

 
groups

 

 
availability

 

 
nodeTypes

 

 
contact

mgnl:contact

Properties

  • availability
    • access: Section 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: Section is available if the selected item is a node.
    • nodeTypes: Sectionis 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
      $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") AbstractAvailabilityRule
      .
    • root: Action is available at the workspace root level if true.
    • properties: Action is available if the selected item is a property.

Here's the action bar:

  • With no selection.
  • When a contact is selected.
  • After a contact is deleted.

   

Action bar availability is different from action availability where availability rules are defined on an individual action level and apply to each use of the action. 

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))