1
0
Fork 0
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:
Chaim Lev-Ari 2023-11-15 09:33:29 +02:00 committed by GitHub
parent 3525a1af77
commit 51474262eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 53 additions and 38 deletions

View file

@ -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 -->

View file

@ -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();

View file

@ -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 -->

View file

@ -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 -->

View file

@ -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();
}

View file

@ -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 -->

View file

@ -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 -->

View file

@ -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();