Skip to content

Commit a7b71c6

Browse files
Added check isAdmin for editing eservices attributes
1 parent 80b5599 commit a7b71c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pages/ProviderEServiceDetailsPage/components/ProviderEServiceDetailsTab/ProviderEServiceDescriptorAttributes.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useGetDelegationUserRole } from '@/hooks/useGetDelegationUserRole'
1616
export const ProviderEServiceDescriptorAttributes: React.FC = () => {
1717
const { t } = useTranslation('eservice', { keyPrefix: 'read.sections.attributes' })
1818
const { t: tCommon } = useTranslation('common')
19-
const { jwt } = AuthHooks.useJwt()
19+
const { jwt, isAdmin } = AuthHooks.useJwt()
2020

2121
const { eserviceId, descriptorId } = useParams<'PROVIDE_ESERVICE_MANAGE'>()
2222
const { data: descriptorAttributes } = useSuspenseQuery({
@@ -35,7 +35,7 @@ export const ProviderEServiceDescriptorAttributes: React.FC = () => {
3535
}>({ isOpen: false, kind: 'certified' })
3636

3737
const getAttributeSectionActions = (kind: AttributeKey): Array<ActionItemButton> | undefined => {
38-
if (descriptorAttributes[kind].length === 0 || isDelegator) return
38+
if (descriptorAttributes[kind].length === 0 || isDelegator || !isAdmin) return
3939

4040
return [
4141
{
@@ -45,7 +45,6 @@ export const ProviderEServiceDescriptorAttributes: React.FC = () => {
4545
},
4646
]
4747
}
48-
4948
return (
5049
<>
5150
<SectionContainer title={t('title')} description={t('description')}>

0 commit comments

Comments
 (0)