@@ -122,7 +136,9 @@ export const RolesResourcesActions = connect((props) => {
let scope = null;
if (actionMap[item.name]) {
enabled = true;
- scope = actionMap[item.name]['scope'];
+ if (!item.onNewRecord) {
+ scope = actionMap[item.name]['scope'];
+ }
}
return {
...item,
diff --git a/packages/client/src/block-provider/BlockProvider.tsx b/packages/client/src/block-provider/BlockProvider.tsx
index 1ba482776..4b8b8e1c4 100644
--- a/packages/client/src/block-provider/BlockProvider.tsx
+++ b/packages/client/src/block-provider/BlockProvider.tsx
@@ -4,7 +4,7 @@ import { useRequest } from 'ahooks';
import template from 'lodash/template';
import React, { createContext, useContext } from 'react';
import { Link } from 'react-router-dom';
-import { TableFieldResource, useAPIClient, useRecord } from '../';
+import { ACLCollectionProvider, TableFieldResource, useAPIClient, useRecord } from '../';
import { CollectionProvider, useCollection, useCollectionManager } from '../collection-manager';
import { useRecordIndex } from '../record-provider';
@@ -89,7 +89,9 @@ export const useResourceAction = (props, opts = {}) => {
const MaybeCollectionProvider = (props) => {
const { collection } = props;
return collection ? (
-
{props.children}
+
+ {props.children}
+
) : (
<>{props.children}>
);
@@ -183,5 +185,9 @@ export const RecordLink = (props) => {
const record = useRecord();
const { title, to, ...others } = props;
const compiled = template(to || '');
- return
{field.title};
+ return (
+
+ {field.title}
+
+ );
};
diff --git a/packages/client/src/route-switch/antd/admin-layout/index.tsx b/packages/client/src/route-switch/antd/admin-layout/index.tsx
index 0c104b9e3..b8773acc7 100644
--- a/packages/client/src/route-switch/antd/admin-layout/index.tsx
+++ b/packages/client/src/route-switch/antd/admin-layout/index.tsx
@@ -3,6 +3,7 @@ import { Layout } from 'antd';
import React, { useRef, useState } from 'react';
import { useHistory, useRouteMatch } from 'react-router-dom';
import {
+ ACLAllowConfigure, ACLRolesCheckProvider,
CurrentUser,
CurrentUserProvider,
findByUid,
@@ -97,16 +98,18 @@ const InternalAdminLayout = (props: any) => {