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

Compare with Current View Page History

« Previous Version 14 Next »

Summary

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

 

Availability

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.

 

The availability is based on the selection although specific exceptions exists. For instance not all actions operate on a selected node.

 

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

 

For redo/undo we will enable/disable based on the undo history size.

 

Configuration proposal

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

 

 

 

 

 

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

-

 

 

 

Access Control

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

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

 

  • No labels