@@ -3,13 +3,15 @@ import React from 'react';
3
3
import { ArrowUpRightFromSquare } from '@gravity-ui/icons' ;
4
4
import { Icon } from '@gravity-ui/uikit' ;
5
5
6
+ import { selectIsUserAllowedToMakeChanges } from '../../store/reducers/authentication/authentication' ;
6
7
import type { PreparedNode } from '../../store/reducers/node/types' ;
7
8
import type { AdditionalNodesProps } from '../../types/additionalProps' ;
8
9
import { cn } from '../../utils/cn' ;
9
10
import {
10
11
createDeveloperUIInternalPageHref ,
11
12
createDeveloperUILinkWithNodeId ,
12
13
} from '../../utils/developerUI/developerUI' ;
14
+ import { useTypedSelector } from '../../utils/hooks' ;
13
15
import { EntityStatus } from '../EntityStatus/EntityStatus' ;
14
16
import { Tags } from '../Tags' ;
15
17
@@ -24,6 +26,8 @@ interface BasicNodeViewerProps {
24
26
}
25
27
26
28
export const BasicNodeViewer = ( { node, additionalNodesProps, className} : BasicNodeViewerProps ) => {
29
+ const isUserAllowedToMakeChanges = useTypedSelector ( selectIsUserAllowedToMakeChanges ) ;
30
+
27
31
let developerUIInternalHref : string | undefined ;
28
32
29
33
if ( additionalNodesProps ?. getNodeRef ) {
@@ -42,7 +46,7 @@ export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNo
42
46
< React . Fragment >
43
47
< div className = { b ( 'title' ) } > Node</ div >
44
48
< EntityStatus status = { node . SystemState } name = { node . Host } />
45
- { developerUIInternalHref && (
49
+ { developerUIInternalHref && isUserAllowedToMakeChanges ? (
46
50
< a
47
51
rel = "noopener noreferrer"
48
52
className = { b ( 'link' , { external : true } ) }
@@ -51,7 +55,7 @@ export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNo
51
55
>
52
56
< Icon data = { ArrowUpRightFromSquare } />
53
57
</ a >
54
- ) }
58
+ ) : null }
55
59
56
60
< div className = { b ( 'id' ) } >
57
61
< label className = { b ( 'label' ) } > NodeID</ label >
0 commit comments