fix: root role is not displayed

This commit is contained in:
chenos 2022-04-10 21:02:05 +08:00
parent c4afb7586c
commit b586d370f0
2 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,7 @@ export const ACLRolesCheckProvider = (props) => {
},
{
onSuccess(data) {
if (!data?.data?.allowConfigure) {
if (!data?.data?.allowConfigure && !data?.data?.allowAll) {
setDesignable(false);
}
},

View File

@ -8,7 +8,12 @@ import { useCurrentUserContext } from './CurrentUserProvider';
const useCurrentRoles = () => {
const { data } = useCurrentUserContext();
return [
...(data?.data?.roles || []),
...(data?.data?.roles || []).map(item => {
return {
title: item.title,
name: item.name,
}
}),
{
title: 'Anonymous',
name: 'anonymous',