fix: read permission; incorrect name; redirect (#5541)

This commit is contained in:
伍闲犬
2025-08-26 17:57:59 +08:00
committed by GitHub
parent 93e9cb675d
commit 3fb1ff2614
3 changed files with 9 additions and 9 deletions

View File

@@ -88,13 +88,6 @@ export const authAppByTmbId = async ({
}; };
} }
if (app.favourite || app.quick) {
return {
...app,
permission: new AppPermission({ isOwner: false, role: ReadRoleVal })
};
}
const isOwner = tmbPer.isOwner || String(app.tmbId) === String(tmbId); const isOwner = tmbPer.isOwner || String(app.tmbId) === String(tmbId);
const { Per } = await (async () => { const { Per } = await (async () => {
@@ -119,6 +112,11 @@ export const authAppByTmbId = async ({
resourceType: PerResourceTypeEnum.app resourceType: PerResourceTypeEnum.app
}); });
const Per = new AppPermission({ role, isOwner }); const Per = new AppPermission({ role, isOwner });
if (app.favourite || app.quick) {
Per.addRole(ReadRoleVal);
}
return { return {
Per Per
}; };

View File

@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next';
import { useMount } from 'ahooks'; import { useMount } from 'ahooks';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useUserStore } from '@/web/support/user/useUserStore';
const HomepageSetting = dynamic(() => import('@/pageComponents/chat/ChatSetting/HomepageSetting')); const HomepageSetting = dynamic(() => import('@/pageComponents/chat/ChatSetting/HomepageSetting'));
const LogDetails = dynamic(() => import('@/pageComponents/chat/ChatSetting/LogDetails')); const LogDetails = dynamic(() => import('@/pageComponents/chat/ChatSetting/LogDetails'));
@@ -28,6 +29,7 @@ const ChatSetting = () => {
const { isPc } = useSystem(); const { isPc } = useSystem();
const { t } = useTranslation(); const { t } = useTranslation();
const { feConfigs } = useSystemStore(); const { feConfigs } = useSystemStore();
const { userInfo } = useUserStore();
const { tab: tabQuery } = router.query as { tab: ChatSettingTabOptionEnum }; const { tab: tabQuery } = router.query as { tab: ChatSettingTabOptionEnum };
const [isOpenDiagram, setIsOpenDiagram] = useState(false); const [isOpenDiagram, setIsOpenDiagram] = useState(false);
@@ -60,7 +62,7 @@ const ChatSetting = () => {
); );
useMount(() => { useMount(() => {
if (!feConfigs?.isPlus) { if (!feConfigs?.isPlus || !userInfo?.team.permission.hasManagePer) {
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS); handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
} }
}); });

View File

@@ -64,7 +64,7 @@ const UserAvatarPopover = ({
> >
<Avatar src={userInfo?.avatar} bg="myGray.200" borderRadius="50%" w={5} h={5} /> <Avatar src={userInfo?.avatar} bg="myGray.200" borderRadius="50%" w={5} h={5} />
<Box flex="1 1 0" minW="0" whiteSpace="pre-wrap"> <Box flex="1 1 0" minW="0" whiteSpace="pre-wrap">
{userInfo?.username ?? '-'} {userInfo?.team.memberName ?? '-'}
</Box> </Box>
</Flex> </Flex>
)} )}