Permission (#1687)
Co-authored-by: Archer <545436317@qq.com> Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { UpdateTeamProps } from '@fastgpt/global/support/user/team/controller';
|
||||
import { authTeamOwner } from '@fastgpt/service/support/permission/auth/user';
|
||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||
import { updateTeam } from '@fastgpt/service/support/user/team/controller';
|
||||
import { ManagePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||
|
||||
export type updateQuery = {};
|
||||
|
||||
@@ -13,7 +14,7 @@ export type updateResponse = {};
|
||||
async function handler(req: ApiRequestProps<updateBody, updateQuery>, res: ApiResponseType<any>) {
|
||||
const body = req.body as UpdateTeamProps;
|
||||
|
||||
const { teamId } = await authTeamOwner({ req, authToken: true });
|
||||
const { teamId } = await authUserPer({ req, authToken: true, per: ManagePermissionVal });
|
||||
|
||||
await updateTeam({ teamId, ...body });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user