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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user