mirror of
https://github.com/certd/certd.git
synced 2026-06-24 19:47:34 +08:00
chore: project query
This commit is contained in:
@@ -28,7 +28,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
//管理员有权限查看其他用户的数据
|
||||
async checkEntityUserId(ctx: any, service: any, ids: number| number[] = null, userKey = 'userId') {
|
||||
async checkUserIdButAllowAdmin(ctx: any, service: any, ids: number| number[] = null, userKey = 'userId') {
|
||||
const isAdmin = await this.isAdmin(ctx);
|
||||
if (isAdmin) {
|
||||
return true;
|
||||
@@ -36,7 +36,11 @@ export class AuthService {
|
||||
await service.checkUserId(ids, ctx.user.id, userKey);
|
||||
}
|
||||
|
||||
async checkEntityProjectId(service:any,ids:number| number[] = null,projectId = null){
|
||||
async checkProjectId(service:any,ids:number| number[] = null,projectId = null){
|
||||
await service.checkUserId(ids, projectId , "projectId");
|
||||
}
|
||||
|
||||
async checkUserId(service:any,ids:number| number[] = null,userId = null){
|
||||
await service.checkUserId(ids, userId , "userId");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user