feat: restrict permission roles
This commit is contained in:
@@ -23,7 +23,7 @@ func (s *AuthService) ValidateUser(username string, password string) (*models.Us
|
||||
if result.Error != nil {
|
||||
return nil, errors.New("用户名或密码不正确")
|
||||
}
|
||||
if user.Role != "admin" && user.Role != "technician" {
|
||||
if !models.HasBackendAccess(user.Role) {
|
||||
return nil, errors.New("用户名或密码不正确")
|
||||
}
|
||||
if user.Password == "" {
|
||||
|
||||
Reference in New Issue
Block a user