fix(registry): non admin can see add registry button [BE-10834] (#12112)

pull/12119/head
Oscar Zhou 2024-08-21 11:00:00 +12:00 committed by GitHub
parent a39abe61c2
commit 8cd53a4b7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 6 deletions

View File

@ -1,12 +1,16 @@
import { Authorized } from '@/react/hooks/useUser';
import { AddButton as BaseAddButton } from '@@/buttons';
export function AddButton() {
return (
<BaseAddButton
data-cy="registry-addRegistryButton"
to="portainer.registries.new"
>
Add registry
</BaseAddButton>
<Authorized authorizations="OperationPortainerRegistryCreate">
<BaseAddButton
data-cy="registry-addRegistryButton"
to="portainer.registries.new"
>
Add registry
</BaseAddButton>
</Authorized>
);
}