Rename general variable name isWritable to hasWritePermission.

This commit is contained in:
takezoe
2013-07-03 01:51:41 +09:00
parent 14187795fb
commit 0bda8cdab7
9 changed files with 20 additions and 16 deletions

View File

@@ -56,6 +56,7 @@ 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