Do not allow inactive users to access repositories using private keys (#3887) (#3889)

release/v1.4
Lauris BH 6 years ago committed by GitHub
parent 40c6eb0d85
commit e35d7ae1fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -230,6 +230,12 @@ func runServ(c *cli.Context) error {
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
}
if !user.IsActive || user.ProhibitLogin {
fail("Your account is not active or has been disabled by Administrator",
"User %s is disabled and have no access to repository %s",
user.Name, repoPath)
}
mode, err := models.AccessLevel(user.ID, repo)
if err != nil {
fail("Internal error", "Failed to check access: %v", err)

Loading…
Cancel
Save