mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
chore:
This commit is contained in:
@@ -107,6 +107,18 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
return await super.update(param);
|
||||
}
|
||||
|
||||
async getSimpleInfo(id: number) {
|
||||
const entity = await this.info(id);
|
||||
if (entity == null) {
|
||||
throw new ValidateException('该授权配置不存在,请确认是否已被删除');
|
||||
}
|
||||
return {
|
||||
id: entity.id,
|
||||
name: entity.name,
|
||||
userId: entity.userId,
|
||||
};
|
||||
}
|
||||
|
||||
async getAccessById(id: any, checkUserId: boolean, userId?: number): Promise<any> {
|
||||
const entity = await this.info(id);
|
||||
if (entity == null) {
|
||||
|
||||
@@ -27,6 +27,7 @@ export class AuthService {
|
||||
}
|
||||
}
|
||||
|
||||
//管理员有权限查看其他用户的数据
|
||||
async checkEntityUserId(ctx: any, service: any, id: any = 0, userKey = 'userId') {
|
||||
const isAdmin = await this.isAdmin(ctx);
|
||||
if (isAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user