Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect explicitly empty action arrays (i.e. lack of permissions) #1182

Merged

Conversation

AFaust
Copy link
Contributor

@AFaust AFaust commented Aug 1, 2016

Recreation of #1174

Any array of item-level actions, either explicitly define or loaded from a backend, must be respected by the alfresco/renderer/Actions module (or any of its derivatives). An empty array of item-level actions loaded from the Share data web script may be the result of a lack of permissions by the current user or simply an action set configured as empty by a developer / administrator in the Share configuration.

Currently, the ActionsMixin will fallback on the default "widgetsForActions" when

-mergeActions is set to false, and
-customActions is either not defined or an empty array, and
-currentItem.actions is either not defined or an empty array

The point of either configuring an explicit empty array for customActions or configuring Share actions in a way that may result in an emty item-level action list is to ensure the user can't perform any action on the item if pre-conditions are not met. Ignoring this valid and explicit state and falling back to a (default) widgetsForActions config is not appropriate.

This PR changes the behaviour to always respect the presence of an actions array even if it may have a length of zero.

@draperd
Copy link

draperd commented Aug 1, 2016

Merged - thanks for making the requested changes!

@AFaust AFaust deleted the ActionsMixin-emptyActionsArrayIsValid branch August 4, 2016 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants