|
|
@ -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,9 +165,8 @@ 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 (row.owner != "wso2.system.user") {
|
|
|
|
if ($.hasPermission("SHARE_GROUP")) {
|
|
|
|
if ($.hasPermission("SHARE_GROUP")) {
|
|
|
|
html +=
|
|
|
|
html +=
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view share-group-link" data-group-id="'
|
|
|
|
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view share-group-link" data-group-id="'
|
|
|
@ -177,8 +175,6 @@ function loadGroups() {
|
|
|
|
+ '"><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="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>';
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">Share</span></a>';
|
|
|
|
} else {
|
|
|
|
|
|
|
|
html += '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($.hasPermission("UPDATE_GROUP")) {
|
|
|
|
if ($.hasPermission("UPDATE_GROUP")) {
|
|
|
|
html +=
|
|
|
|
html +=
|
|
|
@ -188,8 +184,6 @@ function loadGroups() {
|
|
|
|
+ '" data-group-id="' + row.groupId
|
|
|
|
+ '" data-group-id="' + row.groupId
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
+ '"><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>';
|
|
|
|
'<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 ($.hasPermission("REMOVE_GROUP")) {
|
|
|
|
html +=
|
|
|
|
html +=
|
|
|
@ -199,13 +193,11 @@ function loadGroups() {
|
|
|
|
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i>'
|
|
|
|
+ '"><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>';
|
|
|
|
'</span><span class="hidden-xs hidden-on-grid-view">Delete</span></a>';
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
html += '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return html;
|
|
|
|
return html;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
var fnCreatedRow = function (row, data) {
|
|
|
|
var fnCreatedRow = function (row, data) {
|
|
|
|