diff --git a/package.json b/package.json
index 6f631825c..60ef3b3f4 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,11 @@
"wazuh",
"ossec"
],
+ "agents": {
+ "add": true,
+ "delete": true,
+ "restart": true
+ },
"author": "Wazuh, Inc",
"license": "GPL-2.0",
"repository": {
diff --git a/public/controllers/agentsPreview.js b/public/controllers/agentsPreview.js
index 5d775d75f..f6d594c74 100644
--- a/public/controllers/agentsPreview.js
+++ b/public/controllers/agentsPreview.js
@@ -43,6 +43,11 @@ app.controller('agentsPreviewController', function ($scope, $mdDialog, DataFacto
'name': '', 'ip': ''
};
$scope.newAgentKey = '';
+ $scope.permissions = {
+ 'add': false,
+ 'delete':false,
+ 'restart': false
+ };
const notify = new Notifier({location: 'Agents - Preview'});
@@ -264,6 +269,15 @@ app.controller('agentsPreviewController', function ($scope, $mdDialog, DataFacto
$mdDialog.hide('#newAgentDialog');
};
+ var getAgentsPermissions = function () {
+ genericReq.request('GET', '/api/wazuh-api/agents/permissions')
+ .then(function (data, status) {
+ $scope.permissions = data;
+ }, function (data, status) {
+ notify.error("Error while loading agents permissions.");
+ })
+ }
+ getAgentsPermissions();
var load = function () {
$scope.newAgent = {
'name': '', 'ip': ''
diff --git a/public/templates/agents-preview.html b/public/templates/agents-preview.html
index 16a65daa8..dfea34e2d 100644
--- a/public/templates/agents-preview.html
+++ b/public/templates/agents-preview.html
@@ -127,15 +127,15 @@