Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

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

Table of Contents

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

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.

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?

 

...

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 will show the action as disabled in the actionbar.

 

Appendix 1 - The current availability behaviour

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

...

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

...

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.

...

  • 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.