mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
fix: wrap link to edit context field in hasAccess check
This commit is contained in:
parent
f2b4158e53
commit
3c140110fe
@ -4,7 +4,7 @@ import HeaderTitle from '../../common/HeaderTitle';
|
|||||||
import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender';
|
import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender';
|
||||||
import {
|
import {
|
||||||
CREATE_CONTEXT_FIELD,
|
CREATE_CONTEXT_FIELD,
|
||||||
DELETE_CONTEXT_FIELD,
|
DELETE_CONTEXT_FIELD, UPDATE_CONTEXT_FIELD,
|
||||||
} from '../../providers/AccessProvider/permissions';
|
} from '../../providers/AccessProvider/permissions';
|
||||||
import {
|
import {
|
||||||
IconButton,
|
IconButton,
|
||||||
@ -39,10 +39,10 @@ const ContextList = ({ removeContextField, history, contextFields }) => {
|
|||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={
|
primary={
|
||||||
<Link to={`/context/edit/${field.name}`}>
|
<ConditionallyRender condition={hasAccess(UPDATE_CONTEXT_FIELD)} show={<Link to={`/context/edit/${field.name}`}>
|
||||||
<strong>{field.name}</strong>
|
<strong>{field.name}</strong>
|
||||||
</Link>
|
</Link>
|
||||||
}
|
} elseShow={<strong>{field.name}</strong>} />}
|
||||||
secondary={field.description}
|
secondary={field.description}
|
||||||
/>
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
Loading…
Reference in New Issue
Block a user