mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:52:20 +08:00
chore: 流水线有效期优化
This commit is contained in:
@@ -85,6 +85,12 @@ export class PipelineController extends CrudController<PipelineService> {
|
||||
} else {
|
||||
bean.userId = this.getUserId();
|
||||
}
|
||||
|
||||
if(!this.isAdmin()){
|
||||
// 非管理员用户 不允许设置流水线有效期
|
||||
delete bean.validTime
|
||||
}
|
||||
|
||||
await this.service.save(bean);
|
||||
//是否增加证书监控
|
||||
if (bean.addToMonitorEnabled && bean.addToMonitorDomains) {
|
||||
|
||||
@@ -20,7 +20,7 @@ export class AuthService {
|
||||
return true;
|
||||
}
|
||||
|
||||
async isAdmin(ctx: any) {
|
||||
isAdmin(ctx: any) {
|
||||
const roleIds: number[] = ctx.user.roles;
|
||||
if (roleIds.includes(1)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user