1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 06:49:40 +02:00

feat(registries): Registry browser for non-admins [EE-2459] (#6549)

* feat(registries): allow non-admin users to see environment registries

* remove unused function

* fix error message

* fix test

* fix imports order

* feat(registry): check access first, add parameters name

* use registryID

* fix(sidebar): allow standard users to see endpoint registries view

Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
This commit is contained in:
Marcelo Rydel 2022-04-07 10:22:31 -03:00 committed by GitHub
parent 77e48bfb74
commit f9f937f844
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 226 additions and 202 deletions

View file

@ -2,12 +2,13 @@ import KubernetesNamespaceHelper from 'Kubernetes/helpers/namespaceHelper';
export default class KubernetesRegistryAccessController {
/* @ngInject */
constructor($async, $state, ModalService, EndpointService, Notifications, KubernetesResourcePoolService) {
constructor($async, $state, ModalService, EndpointService, Notifications, RegistryService, KubernetesResourcePoolService) {
this.$async = $async;
this.$state = $state;
this.ModalService = ModalService;
this.Notifications = Notifications;
this.KubernetesResourcePoolService = KubernetesResourcePoolService;
this.RegistryService = RegistryService;
this.EndpointService = EndpointService;
this.state = {
@ -57,7 +58,7 @@ export default class KubernetesRegistryAccessController {
this.state = {
registryId: this.$state.params.id,
};
this.registry = await this.EndpointService.registry(this.endpoint.Id, this.state.registryId);
this.registry = await this.RegistryService.registry(this.state.registryId, this.endpoint.Id);
if (this.registry.RegistryAccesses && this.registry.RegistryAccesses[this.endpoint.Id]) {
this.savedResourcePools = this.registry.RegistryAccesses[this.endpoint.Id].Namespaces.map((value) => ({ value }));
}