1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(docker): hide write buttons for non authorized [EE-6775] (#11260)
Some checks failed
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled

This commit is contained in:
Chaim Lev-Ari 2024-02-27 12:36:44 +02:00 committed by GitHub
parent d8e374fb76
commit 19a6a5c608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 84 additions and 40 deletions

View file

@ -88,6 +88,14 @@ export function useIsEdgeAdmin({
};
}
/**
* Check if the user has some of the authorizations
*
* @param authorizations a list of authorizations to check
* @param forceEnvironmentId to force the environment id, used where the environment id can't be loaded from the router, like sidebar
* @param adminOnlyCE if true, will return false if the user is not an admin in CE
* @returns query result with isLoading and authorized - authorized is true if the user has some of the authorizations
*/
export function useAuthorizations(
authorizations: string | string[],
forceEnvironmentId?: EnvironmentId,
@ -137,7 +145,7 @@ export function useIsEnvironmentAdmin({
}
/**
* will return true if the user has the authorizations. assumes the user is authenticated and not an admin
* will return true if the user has some of the authorizations. assumes the user is authenticated and not an admin
*
* @private Please use `useAuthorizations` instead. Exported only for angular's authentication service app/portainer/services/authentication.js:154
*/