@@ -3,13 +3,15 @@ import React from 'react';
33import { ArrowUpRightFromSquare } from '@gravity-ui/icons' ;
44import { Icon } from '@gravity-ui/uikit' ;
55
6+ import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication' ;
67import type { PreparedNode } from '../../store/reducers/node/types' ;
78import type { AdditionalNodesProps } from '../../types/additionalProps' ;
89import { cn } from '../../utils/cn' ;
910import {
1011 createDeveloperUIInternalPageHref ,
1112 createDeveloperUILinkWithNodeId ,
1213} from '../../utils/developerUI/developerUI' ;
14+ import { useTypedSelector } from '../../utils/hooks' ;
1315import { EntityStatus } from '../EntityStatus/EntityStatus' ;
1416import { Tags } from '../Tags' ;
1517
@@ -24,6 +26,8 @@ interface BasicNodeViewerProps {
2426}
2527
2628export const BasicNodeViewer = ( { node, additionalNodesProps, className} : BasicNodeViewerProps ) => {
29+ const isUserAllowedToMakeChanges = useTypedSelector ( selectIsUserAllowedToMakeChanges ) ;
30+
2731 let developerUIInternalHref : string | undefined ;
2832
2933 if ( additionalNodesProps ?. getNodeRef ) {
@@ -42,7 +46,7 @@ export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNo
4246 < React . Fragment >
4347 < div className = { b ( 'title' ) } > Node</ div >
4448 < EntityStatus status = { node . SystemState } name = { node . Host } />
45- { developerUIInternalHref && (
49+ { developerUIInternalHref && isUserAllowedToMakeChanges ? (
4650 < a
4751 rel = "noopener noreferrer"
4852 className = { b ( 'link' , { external : true } ) }
@@ -51,7 +55,7 @@ export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNo
5155 >
5256 < Icon data = { ArrowUpRightFromSquare } />
5357 </ a >
54- ) }
58+ ) : null }
5559
5660 < div className = { b ( 'id' ) } >
5761 < label className = { b ( 'label' ) } > NodeID</ label >
0 commit comments