mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(access-control): show only environment users [EE-6315] (#10614)
This commit is contained in:
parent
3525a1af77
commit
51474262eb
17 changed files with 53 additions and 38 deletions
|
@ -56,6 +56,7 @@
|
|||
resource-control="config.ResourceControl"
|
||||
resource-type="resourceType"
|
||||
on-update-success="(onUpdateResourceControlSuccess)"
|
||||
environment-id="endpoint.Id"
|
||||
>
|
||||
</access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
|
|
@ -9,6 +9,7 @@ angular.module('portainer.docker').controller('ConfigController', [
|
|||
'endpoint',
|
||||
function ($scope, $transition$, $state, ConfigService, Notifications, endpoint) {
|
||||
$scope.resourceType = ResourceControlType.Config;
|
||||
$scope.endpoint = endpoint;
|
||||
|
||||
$scope.onUpdateResourceControlSuccess = function () {
|
||||
$state.reload();
|
||||
|
|
|
@ -172,6 +172,7 @@
|
|||
resource-control="container.ResourceControl"
|
||||
resource-type="resourceType"
|
||||
on-update-success="(onUpdateResourceControlSuccess)"
|
||||
environment-id="endpoint.Id"
|
||||
>
|
||||
</access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
resource-control="secret.ResourceControl"
|
||||
resource-type="resourceType"
|
||||
on-update-success="(onUpdateResourceControlSuccess)"
|
||||
environment-id="endpoint.Id"
|
||||
>
|
||||
</access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
|
|
@ -1,39 +1,35 @@
|
|||
import { ResourceControlType } from '@/react/portainer/access-control/types';
|
||||
|
||||
angular.module('portainer.docker').controller('SecretController', [
|
||||
'$scope',
|
||||
'$transition$',
|
||||
'$state',
|
||||
'SecretService',
|
||||
'Notifications',
|
||||
function ($scope, $transition$, $state, SecretService, Notifications) {
|
||||
$scope.resourceType = ResourceControlType.Secret;
|
||||
angular.module('portainer.docker').controller('SecretController', SecretController);
|
||||
|
||||
$scope.onUpdateResourceControlSuccess = function () {
|
||||
$state.reload();
|
||||
};
|
||||
/* @ngInject */
|
||||
function SecretController($scope, $transition$, $state, SecretService, Notifications, endpoint) {
|
||||
$scope.resourceType = ResourceControlType.Secret;
|
||||
$scope.endpoint = endpoint;
|
||||
$scope.onUpdateResourceControlSuccess = function () {
|
||||
$state.reload();
|
||||
};
|
||||
|
||||
$scope.removeSecret = function removeSecret(secretId) {
|
||||
SecretService.remove(secretId)
|
||||
.then(function success() {
|
||||
Notifications.success('Success', 'Secret successfully removed');
|
||||
$state.go('docker.secrets', {});
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove secret');
|
||||
});
|
||||
};
|
||||
$scope.removeSecret = function removeSecret(secretId) {
|
||||
SecretService.remove(secretId)
|
||||
.then(function success() {
|
||||
Notifications.success('Success', 'Secret successfully removed');
|
||||
$state.go('docker.secrets', {});
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove secret');
|
||||
});
|
||||
};
|
||||
|
||||
function initView() {
|
||||
SecretService.secret($transition$.params().id)
|
||||
.then(function success(data) {
|
||||
$scope.secret = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve secret details');
|
||||
});
|
||||
}
|
||||
function initView() {
|
||||
SecretService.secret($transition$.params().id)
|
||||
.then(function success(data) {
|
||||
$scope.secret = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve secret details');
|
||||
});
|
||||
}
|
||||
|
||||
initView();
|
||||
},
|
||||
]);
|
||||
initView();
|
||||
}
|
||||
|
|
|
@ -209,6 +209,7 @@
|
|||
resource-control="service.ResourceControl"
|
||||
resource-type="resourceType"
|
||||
on-update-success="(onUpdateResourceControlSuccess)"
|
||||
environment-id="endpoint.Id"
|
||||
>
|
||||
</access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
resource-control="volume.ResourceControl"
|
||||
resource-type="resourceType"
|
||||
on-update-success="(onUpdateResourceControlSuccess)"
|
||||
environment-id="endpoint.Id"
|
||||
>
|
||||
</access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
|
|
@ -12,6 +12,7 @@ angular.module('portainer.docker').controller('VolumeController', [
|
|||
'endpoint',
|
||||
function ($scope, $state, $transition$, VolumeService, ContainerService, Notifications, HttpRequestHelper, endpoint) {
|
||||
$scope.resourceType = ResourceControlType.Volume;
|
||||
$scope.endpoint = endpoint;
|
||||
|
||||
$scope.onUpdateResourceControlSuccess = function () {
|
||||
$state.reload();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue