@@ -49,6 +49,9 @@ import executionsApi from '@/api/executions'
4949// Hooks
5050import useApi from '@/hooks/useApi'
5151
52+ // RBAC
53+ import { Available } from '@/ui-component/rbac/available'
54+
5255const getIconColor = ( status ) => {
5356 switch ( status ) {
5457 case 'FINISHED' :
@@ -768,39 +771,43 @@ export const ExecutionDetails = ({ open, isPublic, execution, metadata, onClose,
768771 ) }
769772
770773 { ! isPublic && ! localMetadata . isPublic && (
771- < Chip
772- sx = { { ml : 1 , pl : 1 } }
773- icon = {
774- updateExecutionApi . loading ? (
775- < IconLoader size = { 15 } className = 'spin-animation' />
776- ) : (
777- < IconShare size = { 15 } />
778- )
779- }
780- variant = 'outlined'
781- label = { updateExecutionApi . loading ? 'Updating...' : 'Share' }
782- className = { 'button' }
783- onClick = { ( ) => onSharePublicly ( ) }
784- disabled = { updateExecutionApi . loading }
785- />
774+ < Available permission = 'executions:update' >
775+ < Chip
776+ sx = { { ml : 1 , pl : 1 } }
777+ icon = {
778+ updateExecutionApi . loading ? (
779+ < IconLoader size = { 15 } className = 'spin-animation' />
780+ ) : (
781+ < IconShare size = { 15 } />
782+ )
783+ }
784+ variant = 'outlined'
785+ label = { updateExecutionApi . loading ? 'Updating...' : 'Share' }
786+ className = { 'button' }
787+ onClick = { ( ) => onSharePublicly ( ) }
788+ disabled = { updateExecutionApi . loading }
789+ />
790+ </ Available >
786791 ) }
787792
788793 { ! isPublic && localMetadata . isPublic && (
789- < Chip
790- sx = { { ml : 1 , pl : 1 } }
791- icon = {
792- updateExecutionApi . loading ? (
793- < IconLoader size = { 15 } className = 'spin-animation' />
794- ) : (
795- < IconWorld size = { 15 } />
796- )
797- }
798- variant = 'outlined'
799- label = { updateExecutionApi . loading ? 'Updating...' : 'Public' }
800- className = { 'button' }
801- onClick = { ( ) => setShowShareDialog ( true ) }
802- disabled = { updateExecutionApi . loading }
803- />
794+ < Available permission = 'executions:update' >
795+ < Chip
796+ sx = { { ml : 1 , pl : 1 } }
797+ icon = {
798+ updateExecutionApi . loading ? (
799+ < IconLoader size = { 15 } className = 'spin-animation' />
800+ ) : (
801+ < IconWorld size = { 15 } />
802+ )
803+ }
804+ variant = 'outlined'
805+ label = { updateExecutionApi . loading ? 'Updating...' : 'Public' }
806+ className = { 'button' }
807+ onClick = { ( ) => setShowShareDialog ( true ) }
808+ disabled = { updateExecutionApi . loading }
809+ />
810+ </ Available >
804811 ) }
805812
806813 < Box sx = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' , alignContent : 'center' } } >
0 commit comments