优化
This commit is contained in:
@@ -125,7 +125,7 @@ func (r *authorityAccessRepo) CopyAuthority(ctx context.Context, sourceID uint,
|
||||
}
|
||||
parentAllowed := value.ParentID != nil && (allowed[*value.ParentID] || *value.ParentID == actor.AuthorityID)
|
||||
if !parentAllowed {
|
||||
return errors.New("严格角色模式下只能在自己的角色树中复制角色")
|
||||
return errors.New("您提交的角色ID不合法")
|
||||
}
|
||||
}
|
||||
var count int64
|
||||
@@ -168,7 +168,7 @@ func (r *authorityAccessRepo) CopyAuthority(ctx context.Context, sourceID uint,
|
||||
return err
|
||||
}
|
||||
if !allowed {
|
||||
return errors.New("严格角色模式下不能复制当前角色未拥有的 API")
|
||||
return errors.New("存在api不在权限列表中")
|
||||
}
|
||||
}
|
||||
key := api.V1 + "\x00" + api.V2
|
||||
|
||||
Reference in New Issue
Block a user