Details
-
Improvement
-
Resolution: Fixed
-
Major
-
3.0 M3
-
None
-
livetable action visibility custom patch
-
Unknown
-
Description
Currently there is no way to specify, using the json results, which actions to show and which not to show, especially for (but not limited to) custom actions.
In the current implementation, it is required to have edit rights for an item in order to see any action or to be an admin:
macros.vm
#foreach($action in $colprop.get("actions")) if(row.doc_hasadmin || '${action}' == 'view' || (row.doc_hasdelete && '${action}' == 'delete') || (row.doc_hasedit && adminActions.indexOf('${action}') < 0) && '${action}' != 'delete'){ ...
An improvement to this is to use the row.doc_has<action> as a convention and allow each action to specify if it should be displayed or not:
macros.vm
#foreach($action in $colprop.get("actions")) if(row.doc_has${action} || '${action}' == 'view' || (row.doc_has${action} == undefined && (row.doc_hasadmin || adminActions.indexOf('${action}') < 0))) { ...
Note: This also allows overriding an admin's action visibility. This makes sense when dealing with custom actions. If no 'override' is specified, the action is displayed by default, as it does now.
Attachments
Issue Links
- blocks
-
WIKITHREEDOTO-22 Workspace directory for users willing to discover available workspaces
- Closed