优化接口权限

This commit is contained in:
GoEdgeLab
2022-09-17 16:07:37 +08:00
parent 26c32e0621
commit 6aafa656a6
54 changed files with 275 additions and 246 deletions

View File

@@ -13,7 +13,7 @@ type SysLockerService struct {
// SysLockerLock 获得锁
func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLockerLockRequest) (*pb.SysLockerLockResponse, error) {
_, userId, err := this.ValidateAdminAndUser(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx, false)
if err != nil {
_, err = this.ValidateMonitorNode(ctx)
if err != nil {
@@ -43,7 +43,7 @@ func (this *SysLockerService) SysLockerLock(ctx context.Context, req *pb.SysLock
// SysLockerUnlock 释放锁
func (this *SysLockerService) SysLockerUnlock(ctx context.Context, req *pb.SysLockerUnlockRequest) (*pb.RPCSuccess, error) {
_, userId, err := this.ValidateAdminAndUser(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx, false)
if err != nil {
_, err = this.ValidateMonitorNode(ctx)
if err != nil {