mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 14:16:26 +00:00
fix(acl): add x-acl-action to action schema
This commit is contained in:
parent
6b253755a1
commit
e5a9721674
@ -116,6 +116,7 @@ export const CalendarFormActionInitializers = {
|
|||||||
title: '{{ t("Update record") }}',
|
title: '{{ t("Update record") }}',
|
||||||
'x-component': 'Action',
|
'x-component': 'Action',
|
||||||
'x-designer': 'Action.Designer',
|
'x-designer': 'Action.Designer',
|
||||||
|
'x-acl-action': 'update',
|
||||||
'x-action': 'customize:update',
|
'x-action': 'customize:update',
|
||||||
'x-action-settings': {
|
'x-action-settings': {
|
||||||
assignedValues: {},
|
assignedValues: {},
|
||||||
|
@ -108,6 +108,7 @@ export const ReadPrettyFormActionInitializers = {
|
|||||||
'x-component': 'Action',
|
'x-component': 'Action',
|
||||||
'x-designer': 'Action.Designer',
|
'x-designer': 'Action.Designer',
|
||||||
'x-action': 'customize:update',
|
'x-action': 'customize:update',
|
||||||
|
'x-acl-action': 'update',
|
||||||
'x-action-settings': {
|
'x-action-settings': {
|
||||||
assignedValues: {},
|
assignedValues: {},
|
||||||
onSuccess: {
|
onSuccess: {
|
||||||
|
@ -135,6 +135,7 @@ export const TableActionColumnInitializers = (props: any) => {
|
|||||||
title: '{{ t("Update record") }}',
|
title: '{{ t("Update record") }}',
|
||||||
'x-component': 'Action.Link',
|
'x-component': 'Action.Link',
|
||||||
'x-action': 'customize:update',
|
'x-action': 'customize:update',
|
||||||
|
'x-acl-action': 'update',
|
||||||
'x-designer': 'Action.Designer',
|
'x-designer': 'Action.Designer',
|
||||||
'x-action-settings': {
|
'x-action-settings': {
|
||||||
assignedValues: {},
|
assignedValues: {},
|
||||||
|
@ -37,9 +37,6 @@ export const TableActionInitializers = {
|
|||||||
schema: {
|
schema: {
|
||||||
'x-align': 'right',
|
'x-align': 'right',
|
||||||
'x-decorator': 'ACLActionProvider',
|
'x-decorator': 'ACLActionProvider',
|
||||||
'x-acl-action-props': {
|
|
||||||
skipScopeCheck: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -48,9 +45,6 @@ export const TableActionInitializers = {
|
|||||||
component: 'RefreshActionInitializer',
|
component: 'RefreshActionInitializer',
|
||||||
schema: {
|
schema: {
|
||||||
'x-align': 'right',
|
'x-align': 'right',
|
||||||
'x-acl-action-props': {
|
|
||||||
skipScopeCheck: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -71,6 +65,7 @@ export const TableActionInitializers = {
|
|||||||
title: '{{ t("Bulk update") }}',
|
title: '{{ t("Bulk update") }}',
|
||||||
'x-component': 'Action',
|
'x-component': 'Action',
|
||||||
'x-align': 'right',
|
'x-align': 'right',
|
||||||
|
'x-acl-action': 'update',
|
||||||
'x-decorator': 'ACLActionProvider',
|
'x-decorator': 'ACLActionProvider',
|
||||||
'x-acl-action-props': {
|
'x-acl-action-props': {
|
||||||
skipScopeCheck: true,
|
skipScopeCheck: true,
|
||||||
@ -87,6 +82,7 @@ export const TableActionInitializers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
icon: 'EditOutlined',
|
||||||
useProps: '{{ useCustomizeBulkUpdateActionProps }}',
|
useProps: '{{ useCustomizeBulkUpdateActionProps }}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -98,6 +94,7 @@ export const TableActionInitializers = {
|
|||||||
schema: {
|
schema: {
|
||||||
'x-align': 'right',
|
'x-align': 'right',
|
||||||
'x-decorator': 'ACLActionProvider',
|
'x-decorator': 'ACLActionProvider',
|
||||||
|
'x-acl-action': 'update',
|
||||||
'x-acl-action-props': {
|
'x-acl-action-props': {
|
||||||
skipScopeCheck: true,
|
skipScopeCheck: true,
|
||||||
},
|
},
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
|
import { useCollection } from '../../collection-manager';
|
||||||
|
|
||||||
import { ActionInitializer } from "./ActionInitializer";
|
import { ActionInitializer } from './ActionInitializer';
|
||||||
|
|
||||||
export const BulkDestroyActionInitializer = (props) => {
|
export const BulkDestroyActionInitializer = (props) => {
|
||||||
|
const collection = useCollection();
|
||||||
const schema = {
|
const schema = {
|
||||||
title: '{{ t("Delete") }}',
|
title: '{{ t("Delete") }}',
|
||||||
'x-action': 'destroy',
|
'x-action': 'destroy',
|
||||||
'x-component': 'Action',
|
'x-component': 'Action',
|
||||||
'x-designer': 'Action.Designer',
|
'x-designer': 'Action.Designer',
|
||||||
|
'x-decorator': 'ACLActionProvider',
|
||||||
|
'x-acl-action-props': {
|
||||||
|
skipScopeCheck: true,
|
||||||
|
},
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
icon: 'DeleteOutlined',
|
icon: 'DeleteOutlined',
|
||||||
confirm: {
|
confirm: {
|
||||||
@ -17,5 +23,8 @@ export const BulkDestroyActionInitializer = (props) => {
|
|||||||
useProps: '{{ useBulkDestroyActionProps }}',
|
useProps: '{{ useBulkDestroyActionProps }}',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
if (collection) {
|
||||||
|
schema['x-acl-action'] = `${collection.name}:destroy`;
|
||||||
|
}
|
||||||
return <ActionInitializer {...props} schema={schema} />;
|
return <ActionInitializer {...props} schema={schema} />;
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { BlockInitializer } from '.';
|
import { BlockInitializer } from '.';
|
||||||
|
import { useCollection } from '../../collection-manager';
|
||||||
|
|
||||||
export const CustomizeActionInitializer = (props) => {
|
export const CustomizeActionInitializer = (props) => {
|
||||||
return <BlockInitializer {...props} />;
|
const collection = useCollection();
|
||||||
|
const schema = {};
|
||||||
|
if (collection && schema['x-acl-action']) {
|
||||||
|
schema['x-acl-action'] = `${collection.name}:${schema['x-acl-action']}`;
|
||||||
|
schema['x-decorator'] = 'ACLActionProvider';
|
||||||
|
}
|
||||||
|
return <BlockInitializer {...props} schema={schema} />;
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,7 @@ export const CustomizeBulkEditActionInitializer = (props) => {
|
|||||||
},
|
},
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
openMode: 'drawer',
|
openMode: 'drawer',
|
||||||
|
icon: 'EditOutlined',
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
drawer: {
|
drawer: {
|
||||||
|
Loading…
Reference in New Issue
Block a user