Skip to content

Commit e35d7ae

Browse files
authored
Do not allow inactive users to access repositories using private keys (#3887) (#3889)
1 parent 40c6eb0 commit e35d7ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/serv.go

+6
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ func runServ(c *cli.Context) error {
230230
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
231231
}
232232

233+
if !user.IsActive || user.ProhibitLogin {
234+
fail("Your account is not active or has been disabled by Administrator",
235+
"User %s is disabled and have no access to repository %s",
236+
user.Name, repoPath)
237+
}
238+
233239
mode, err := models.AccessLevel(user.ID, repo)
234240
if err != nil {
235241
fail("Internal error", "Failed to check access: %v", err)

0 commit comments

Comments
 (0)