Improved model package. The details are as follows:

* Fix the Profiles class from package object to simple object
* Fix the row case class to model package
* Define the alias of JdbcBackend#Session
This commit is contained in:
shimamoto
2014-07-28 04:52:56 +09:00
parent 723de9e81e
commit b13820fc0e
31 changed files with 195 additions and 180 deletions

View File

@@ -5,7 +5,6 @@ import javax.servlet.http._
import service.{SystemSettingsService, AccountService, RepositoryService}
import model._
import org.slf4j.LoggerFactory
import slick.jdbc.JdbcBackend
import util.Implicits._
import util.ControlUtil._
import util.Keys
@@ -67,7 +66,7 @@ class BasicAuthenticationFilter extends Filter with RepositoryService with Accou
}
private def getWritableUser(username: String, password: String, repository: RepositoryService.RepositoryInfo)
(implicit session: JdbcBackend#Session): Option[Account] =
(implicit session: Session): Option[Account] =
authenticate(loadSystemSettings(), username, password) match {
case x @ Some(account) if(hasWritePermission(repository.owner, repository.name, x)) => x
case _ => None

View File

@@ -17,7 +17,7 @@ import WebHookService._
import org.eclipse.jgit.api.Git
import util.JGitUtil.CommitInfo
import service.IssuesService.IssueSearchCondition
import slick.jdbc.JdbcBackend
import model.Session
/**
* Provides Git repository via HTTP.
@@ -95,7 +95,7 @@ class GitBucketReceivePackFactory extends ReceivePackFactory[HttpServletRequest]
import scala.collection.JavaConverters._
class CommitLogHook(owner: String, repository: String, pusher: String, baseUrl: String)(implicit session: JdbcBackend#Session)
class CommitLogHook(owner: String, repository: String, pusher: String, baseUrl: String)(implicit session: Session)
extends PostReceiveHook with PreReceiveHook
with RepositoryService with AccountService with IssuesService with ActivityService with PullRequestService with WebHookService {

View File

@@ -5,7 +5,7 @@ import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
import org.apache.commons.io.IOUtils
import twirl.api.Html
import service.{AccountService, RepositoryService, SystemSettingsService}
import model.Account
import model.{Account, Session}
import util.{JGitUtil, Keys}
import plugin.PluginConnectionHolder
@@ -50,7 +50,7 @@ class PluginActionInvokeFilter extends Filter with SystemSettingsService with Re
}
private def processRepositoryAction(path: String, request: HttpServletRequest, response: HttpServletResponse)
(implicit session: model.profile.simple.Session): Boolean = {
(implicit session: Session): Boolean = {
val elements = path.split("/")
if(elements.length > 3){
val owner = elements(1)