mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Fix TODO.
This commit is contained in:
@@ -54,15 +54,9 @@ class BasicAuthenticationFilter extends Filter with RepositoryService with Accou
|
||||
}
|
||||
|
||||
private def isWritableUser(username: String, password: String, repository: RepositoryService.RepositoryInfo): Boolean = {
|
||||
getAccountByUserName(username) match {
|
||||
case Some(account) if(account.password == encrypt(password)) => {
|
||||
// TODO Use hasWritePermission?
|
||||
(account.isAdmin // administrator
|
||||
|| account.userName == repository.owner // repository owner
|
||||
|| getCollaborators(repository.owner, repository.name).contains(account.userName)) // collaborator
|
||||
}
|
||||
case _ => false
|
||||
}
|
||||
getAccountByUserName(username).map { account =>
|
||||
account.password == encrypt(password) && hasWritePermission(repository.owner, repository.name, Some(account))
|
||||
} getOrElse false
|
||||
}
|
||||
|
||||
private def requireAuth(response: HttpServletResponse): Unit = {
|
||||
|
||||
Reference in New Issue
Block a user