refactor: acl support namespace

This commit is contained in:
katherinehhh 2024-01-18 15:19:06 +08:00
parent ccee2df920
commit 2f9f42dca8

View File

@ -94,7 +94,7 @@ export const ACLActionParamsContext = createContext<any>({});
export const useACLRolesCheck = () => {
const ctx = useContext(ACLContext);
const ns = useCollectionNamespace();
const { dataSources: dataSourcesAcl } = ctx.data.meta;
const { dataSources: dataSourcesAcl } = ctx?.data?.meta || {};
const data = { ...ctx?.data?.data, ...omit(dataSourcesAcl?.[ns], 'snippets') };
const getActionAlias = (actionPath: string) => {
const actionName = actionPath.split(':').pop();