Don't add group account as a collaborator.

This commit is contained in:
takezoe
2013-10-24 02:08:14 +09:00
parent 53fa60b0f8
commit 0d0bf4ad3f

View File

@@ -188,6 +188,8 @@ trait RepositorySettingsControllerBase extends ControllerBase with FlashMapSuppo
override def validate(name: String, value: String): Option[String] = override def validate(name: String, value: String): Option[String] =
getAccountByUserName(value) match { getAccountByUserName(value) match {
case None => Some("User does not exist.") case None => Some("User does not exist.")
case Some(x) if(x.isGroupAccount)
=> Some("User does not exist.")
case Some(x) if(x.userName == params("owner") || getCollaborators(params("owner"), params("repository")).contains(x.userName)) case Some(x) if(x.userName == params("owner") || getCollaborators(params("owner"), params("repository")).contains(x.userName))
=> Some("User can access this repository already.") => Some("User can access this repository already.")
case _ => None case _ => None