mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
Add User's IsForbidden.
This commit is contained in:
@ -65,6 +65,10 @@ func CheckUserLogin(organization string, username string, password string) (*Use
|
||||
return nil, "password incorrect"
|
||||
}
|
||||
|
||||
if user.IsForbidden {
|
||||
return nil, "the user is forbidden to sign in, please contact the administrator"
|
||||
}
|
||||
|
||||
return user, ""
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ func initBuiltInUser() {
|
||||
Tag: "staff",
|
||||
IsAdmin: true,
|
||||
IsGlobalAdmin: true,
|
||||
IsForbidden: false,
|
||||
}
|
||||
AddUser(user)
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ type User struct {
|
||||
Tag string `xorm:"varchar(100)" json:"tag"`
|
||||
IsAdmin bool `json:"isAdmin"`
|
||||
IsGlobalAdmin bool `json:"isGlobalAdmin"`
|
||||
IsForbidden bool `json:"isForbidden"`
|
||||
|
||||
Github string `xorm:"varchar(100)" json:"github"`
|
||||
Google string `xorm:"varchar(100)" json:"google"`
|
||||
|
Reference in New Issue
Block a user