You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

This concept page describes both how to control when an action is available and how to restrict access to such actions.

Availability

The availability is based on the selection although specific exceptions exists. For instance not all actions operate on a selected node. For redo/undo we will enable/disable based on the undo history size.

Both in the actionbar and in the context menu we want to show actions as enabled or disabled. We do not want to replicate the configuration in both places. Therefore we will configure it on the actions themselves.

On the action definition we need to be able to specify

  • the node types the action is available for
  • whether its available when there's no selection
  • and whether its available for properties

The actionbar should only show one section at a time. The section to show depends on the selected node. Therefore we need to configure:

  • the node types the action is available for
  • whether its available when there's no selection
  • and whether its available for properties

 

Q: We currently toggle show/hide on sections based on the node types. Is this desirable? It has the effect of actions moving around when the selection changes.
A: We never want to show more than one section at a time. The contacts app should be changed to behave this way. 

Q: Do we want to hide a section if all its actions are disabled? What if the user is not authorized to use any of the actions does it then make sense to hide the section?
A: Based on the answer above we should never hide a section because that would make the actionbar empty.

 

Access Control

Determining wether the current user has access to an action should be based on roles. We need to configure the required roles on the action definition.

If the user does not have access we will show the action as disabled in the actionbar.

If no roles are specified on the action definition it is assumed to mean that everybody has access.

 

Appendix 1 - The current availability behaviour

We control availability by hiding sections and disabling groups or individual actions.

Remember that the actionbar is organised in sections that contain groups that contain items. Each item is linked to an action. Actionbar -> sections -> groups -> items.

Sections can be shown/hidden.

Groups and items can be enabled/disabled.

Logic charts for current behaviour

Contacts AppS folderActionsG addActionsG editActionsS contactsActionsG addActionsG editActions
no selection or rootxx xx 
mgnl:folderxxxxx 
any other node   x x
Configuration AppG addingActionsG duplicateActionsG activationActionsG importExportActionsA addFolderA delete
no selection or root    x 
any nodexxxxunless mgnl:contentNode 
property     x
Security Groups/RolesG addActionsG editActions
no selection or rootx 
any node x
Security UsersG addActionsG editActions
/admin or /systemx 
any node x
AssetsS folderActionsS assetsActionsA createVariant
no selection or root x 
mgnl:folderx  
any other node xonly if node is master
PagesA deleteA previewA editA exportA activateA deactivateA activateRecursive
no selection or root       
any selectionxxxxxxonly if no sub pages

 

 

Configuration proposal (rejected)

on each level, section, group, action, we need to configure three things:

 

NameTypeDefaultDescription
noSelectionbooleanfalseavailable when no selection or not
nodeTypesnode node with subnodes for each node type
propertiesbooleanfalseavailable for properties or not

 

if no constraints are configured for an action it takes the decision of the containing group, otherwise it takes its own decision

there is no way to configure availability for all node types

there is still a need for custom logic, like for checking activateRecursive, which is fine, because its unusual, but for undo/redo there ALWAYS has to be a custom check

 

 

 

 

Appendix 2 - Previous notes

Problem

The action bar can take several states within one sub-app.

  • In page editor, some actions are displayed or hidden according to the type of selection (page, area, optional area, component)
  • This is currently handled in a dirty way:
    • The action bar provides an API for showing/hiding a whole section
    • Therefore the page editor sub-app defines 7 different sections, which mostly hold similar groups, and sometimes even similar (i.e. duplicated) action definitions.
  • Sometimes the context sensitivity is only represented by enabling/disabling one or several actions
    • Each sub-app has to reimplement the itemSelected listener to control proper enablement of actions
    • Basic conditional enablement is not ensured, nor is it configurable
    • One cannot easily control which actions are available (visible/enabled) based on parameters out of configuration (roles, instance)
  • Conditional enablement of actions has already caused many issues before alpha1

Proposal

  • Action bar definition should define two things:
    • the structure: sections, groups, and all possible actions in these groups, in one single place. This ensures proper ordering of actions at all time
    • the states that describe e.g. the section titles, the set of actions displayed, and potential substates. This mechanism should allow for additive composition of states (think of the use case for an optional AND editable area in page editor)
  • Implementing context sensitivity then only means to configure these states properly and toggle between them.
  • (warning)It is likely that context sensitivity is not handled at all at the action bar level, but rather straight on the actions.
    • If so, the action bar definition is reduced to its sole structure.
    • Edge case (page editor): do we provide a way to configure context-sensitive section titles?

Decision

-

 

 

 

  • No labels