perf: logs, auth root as super admin, etc (#2615)

* chore: usePagination hook type

* feat: chat log show outlinkuid or tmb avatar and name

* fix: ts error for pagination

* feat: auth root
This commit is contained in:
Finley Ge
2024-09-09 10:05:18 +08:00
committed by GitHub
parent 91ec895fd2
commit a1ae08f62b
19 changed files with 127 additions and 66 deletions

View File

@@ -38,11 +38,13 @@ export const authPluginByTmbId = async ({
export const authAppByTmbId = async ({
tmbId,
appId,
per
per,
isRoot
}: {
tmbId: string;
appId: string;
per: PermissionValueType;
isRoot?: boolean;
}): Promise<{
app: AppDetailType;
}> => {
@@ -55,6 +57,14 @@ export const authAppByTmbId = async ({
return Promise.reject(AppErrEnum.unExist);
}
if (isRoot) {
return {
...app,
defaultPermission: app.defaultPermission,
permission: new AppPermission({ isOwner: true })
};
}
if (String(app.teamId) !== teamId) {
return Promise.reject(AppErrEnum.unAuthApp);
}
@@ -136,7 +146,8 @@ export const authApp = async ({
const { app } = await authAppByTmbId({
tmbId,
appId,
per
per,
isRoot: result.isRoot
});
return {