|
|
@ -93,7 +93,7 @@ function loadGroups() {
|
|
|
|
var currentUser = groupListing.data("currentUser");
|
|
|
|
var currentUser = groupListing.data("currentUser");
|
|
|
|
var serviceURL;
|
|
|
|
var serviceURL;
|
|
|
|
if ($.hasPermission("LIST_ALL_GROUPS")) {
|
|
|
|
if ($.hasPermission("LIST_ALL_GROUPS")) {
|
|
|
|
serviceURL = "/api/device-mgt/v1.0/groups";
|
|
|
|
serviceURL = "/api/device-mgt/v1.0/admin/groups";
|
|
|
|
} else if ($.hasPermission("LIST_GROUPS")) {
|
|
|
|
} else if ($.hasPermission("LIST_GROUPS")) {
|
|
|
|
//Get authenticated users groups
|
|
|
|
//Get authenticated users groups
|
|
|
|
serviceURL = "/api/device-mgt/v1.0/groups/user/" + currentUser;
|
|
|
|
serviceURL = "/api/device-mgt/v1.0/groups/user/" + currentUser;
|
|
|
@ -113,8 +113,7 @@ function loadGroups() {
|
|
|
|
groupId: data.deviceGroups[index].id,
|
|
|
|
groupId: data.deviceGroups[index].id,
|
|
|
|
name: data.deviceGroups[index].name,
|
|
|
|
name: data.deviceGroups[index].name,
|
|
|
|
description: data.deviceGroups[index].description,
|
|
|
|
description: data.deviceGroups[index].description,
|
|
|
|
owner: data.deviceGroups[index].owner,
|
|
|
|
owner: data.deviceGroups[index].owner
|
|
|
|
dateOfCreation: data.deviceGroups[index].dateOfCreation
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var json = {
|
|
|
|
var json = {
|
|
|
@ -153,7 +152,7 @@ function loadGroups() {
|
|
|
|
data: 'id',
|
|
|
|
data: 'id',
|
|
|
|
class: 'text-right content-fill text-left-on-grid-view no-wrap',
|
|
|
|
class: 'text-right content-fill text-left-on-grid-view no-wrap',
|
|
|
|
render: function (id, type, row, meta) {
|
|
|
|
render: function (id, type, row, meta) {
|
|
|
|
var html;
|
|
|
|
var html = '';
|
|
|
|
if ($.hasPermission("VIEW_GROUP_DEVICES")) {
|
|
|
|
if ($.hasPermission("VIEW_GROUP_DEVICES")) {
|
|
|
|
html = '<a href="devices?groupId=' + row.groupId + '&groupName=' + row.name
|
|
|
|
html = '<a href="devices?groupId=' + row.groupId + '&groupName=' + row.name
|
|
|
|
+ '" data-click-event="remove-form" class="btn padding-reduce-on-grid-view">' +
|
|
|
|
+ '" data-click-event="remove-form" class="btn padding-reduce-on-grid-view">' +
|
|
|
@ -166,46 +165,39 @@ function loadGroups() {
|
|
|
|
'<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>'
|
|
|
|
'<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>'
|
|
|
|
+
|
|
|
|
+
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">Analytics</span></a>';
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">Analytics</span></a>';
|
|
|
|
} else {
|
|
|
|
|
|
|
|
html = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($.hasPermission("SHARE_GROUP")) {
|
|
|
|
|
|
|
|
html +=
|
|
|
|
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view share-group-link" data-group-id="'
|
|
|
|
|
|
|
|
+ row.groupId + '" ' +
|
|
|
|
|
|
|
|
'data-group-owner="' + row.owner
|
|
|
|
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-share fw-stack-1x"></i></span>'
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">Share</span></a>';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
html += '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($.hasPermission("UPDATE_GROUP")) {
|
|
|
|
|
|
|
|
html +=
|
|
|
|
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view edit-group-link" data-group-name="'
|
|
|
|
|
|
|
|
+ row.name + '" ' +
|
|
|
|
|
|
|
|
'data-group-owner="' + row.owner + '" data-group-description="' + row.description
|
|
|
|
|
|
|
|
+ '" data-group-id="' + row.groupId
|
|
|
|
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
|
|
|
|
'<i class="fw fw-edit fw-stack-1x"></i></span><span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
html += '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($.hasPermission("REMOVE_GROUP")) {
|
|
|
|
if (row.owner != "wso2.system.user") {
|
|
|
|
html +=
|
|
|
|
if ($.hasPermission("SHARE_GROUP")) {
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-group-link" data-group-id="'
|
|
|
|
html +=
|
|
|
|
+ row.groupId + '" ' +
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view share-group-link" data-group-id="'
|
|
|
|
'data-group-owner="' + row.owner
|
|
|
|
+ row.groupId + '" ' +
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i>'
|
|
|
|
'data-group-owner="' + row.owner
|
|
|
|
+
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-share fw-stack-1x"></i></span>'
|
|
|
|
'</span><span class="hidden-xs hidden-on-grid-view">Delete</span></a>';
|
|
|
|
+
|
|
|
|
} else {
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">Share</span></a>';
|
|
|
|
html += '';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($.hasPermission("UPDATE_GROUP")) {
|
|
|
|
|
|
|
|
html +=
|
|
|
|
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view edit-group-link" data-group-name="'
|
|
|
|
|
|
|
|
+ row.name + '" ' +
|
|
|
|
|
|
|
|
'data-group-owner="' + row.owner + '" data-group-description="' + row.description
|
|
|
|
|
|
|
|
+ '" data-group-id="' + row.groupId
|
|
|
|
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
|
|
|
|
'<i class="fw fw-edit fw-stack-1x"></i></span><span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($.hasPermission("REMOVE_GROUP")) {
|
|
|
|
|
|
|
|
html +=
|
|
|
|
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-group-link" data-group-id="'
|
|
|
|
|
|
|
|
+ row.groupId + '" ' +
|
|
|
|
|
|
|
|
'data-group-owner="' + row.owner
|
|
|
|
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i>'
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
'</span><span class="hidden-xs hidden-on-grid-view">Delete</span></a>';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return html;
|
|
|
|
return html;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
var fnCreatedRow = function (row, data) {
|
|
|
|
var fnCreatedRow = function (row, data) {
|
|
|
|