feat(Can): use new manage permission in checks
This commit is contained in:
@@ -41,7 +41,7 @@ function AdminTemplateContextMenu(props) {
|
||||
hideBackdrop={false}
|
||||
anchorEl={anchorEl}
|
||||
>
|
||||
<Can I="delete" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem disabled={!allowed} onClick={onTemplateDelete}>
|
||||
{formatMessage('adminTemplateContextMenu.delete')}
|
||||
|
||||
@@ -51,7 +51,7 @@ function ContextMenu(props) {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="update" a="Connection" passThrough>
|
||||
<Can I="manage" a="Connection" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem
|
||||
onClick={createActionHandler({ type: 'test' })}
|
||||
@@ -62,7 +62,7 @@ function ContextMenu(props) {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="create" a="Connection" passThrough>
|
||||
<Can I="manage" a="Connection" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem
|
||||
component={Link}
|
||||
@@ -79,7 +79,7 @@ function ContextMenu(props) {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="delete" a="Connection" passThrough>
|
||||
<Can I="manage" a="Connection" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem
|
||||
onClick={createActionHandler({ type: 'delete' })}
|
||||
|
||||
@@ -20,7 +20,7 @@ function AppConnections(props) {
|
||||
|
||||
if (!hasConnections) {
|
||||
return (
|
||||
<Can I="create" a="Connection" passThrough>
|
||||
<Can I="manage" a="Connection" passThrough>
|
||||
{(allowed) => (
|
||||
<NoResultFound
|
||||
text={formatMessage('app.noConnections')}
|
||||
|
||||
@@ -37,7 +37,7 @@ function AppFlows(props) {
|
||||
|
||||
if (!hasFlows) {
|
||||
return (
|
||||
<Can I="create" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<NoResultFound
|
||||
text={formatMessage('app.noFlows')}
|
||||
|
||||
@@ -53,7 +53,7 @@ function DeleteRoleButton(props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Can I="delete" a="Role" passThrough>
|
||||
<Can I="manage" a="Role" passThrough>
|
||||
{(allowed) => (
|
||||
<IconButton
|
||||
disabled={!allowed || disabled}
|
||||
|
||||
@@ -126,7 +126,7 @@ export default function EditorLayout() {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="publish" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<Button
|
||||
disabled={!allowed || !flow}
|
||||
|
||||
@@ -130,7 +130,7 @@ function ContextMenu(props) {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="create" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem disabled={!allowed} onClick={onFlowDuplicate}>
|
||||
{formatMessage('flow.duplicate')}
|
||||
@@ -139,7 +139,7 @@ function ContextMenu(props) {
|
||||
</Can>
|
||||
|
||||
{isCurrentUserAdmin && (
|
||||
<Can I="create" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem disabled={!allowed} onClick={onCreateTemplate}>
|
||||
{formatMessage('flow.createTemplateFromFlow')}
|
||||
@@ -148,7 +148,7 @@ function ContextMenu(props) {
|
||||
</Can>
|
||||
)}
|
||||
|
||||
<Can I="update" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem disabled={!allowed} onClick={onFlowFolderUpdate}>
|
||||
{formatMessage('flow.moveTo')}
|
||||
@@ -164,7 +164,7 @@ function ContextMenu(props) {
|
||||
)}
|
||||
</Can>
|
||||
|
||||
<Can I="delete" a="Flow" passThrough>
|
||||
<Can I="manage" a="Flow" passThrough>
|
||||
{(allowed) => (
|
||||
<MenuItem disabled={!allowed} onClick={onFlowDelete}>
|
||||
{formatMessage('flow.delete')}
|
||||
|
||||
Reference in New Issue
Block a user