Ensuring View Details button is visible if the user has read access and the service is defined in the current Process Group.
This closes
var controllerServiceActionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
- if (dataContext.permissions.canRead && dataContext.permissions.canWrite) {
+ if (dataContext.permissions.canRead) {
var definedByCurrentGroup = false;
if (nfCommon.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
// when opened in the process group context, the current group is store in #process-group-id
}
if (definedByCurrentGroup === true) {
+ if (dataContext.permissions.canWrite) {
+ // write permission... allow actions based on the current state of the service
if (dataContext.component.state === 'ENABLED' || dataContext.component.state === 'ENABLING') {
markup += '<div class="pointer view-controller-service fa fa-gear" title="View Configuration" style="margin-top: 2px; margin-right: 3px;" ></div>';
markup += '<div class="pointer disable-controller-service icon icon-enable-false" title="Disable" style="margin-top: 2px; margin-right: 3px;" ></div>';
markup += '<div title="View State" class="pointer view-state-controller-service fa fa-tasks" style="margin-top: 2px; margin-right: 3px;" ></div>';
}
} else {
+ // no write permission... allow viewing configuration if in current group
+ if (definedByCurrentGroup === true) {
+ markup += '<div class="pointer view-controller-service fa fa-gear" title="View Configuration" style="margin-top: 2px; margin-right: 3px;" ></div>';
+ }
+ }
+ } else {
+ // not defined in current group... show go to arrow
markup += '<div class="pointer go-to-controller-service fa fa-long-arrow-right" title="Go To" style="margin-top: 2px; margin-right: 3px;" ></div>';
}
}
