Fix OneselfAuthenticator.

This commit is contained in:
takezoe
2013-07-03 18:00:45 +09:00
parent b59a4ce94b
commit 45639c1dc5

View File

@@ -8,10 +8,10 @@ import RepositoryService.RepositoryInfo
* Allows only oneself and administrators. * Allows only oneself and administrators.
*/ */
trait OneselfAuthenticator { self: ControllerBase => trait OneselfAuthenticator { self: ControllerBase =>
protected def oneselfOnly(action: (RepositoryInfo) => Any) = { authenticate(action) } protected def oneselfOnly(action: => Any) = { authenticate(action) }
protected def oneselfOnly[T](action: (T, RepositoryInfo) => Any) = (form: T) => { authenticate(action(form, _)) } protected def oneselfOnly[T](action: T => Any) = (form: T) => { authenticate(action(form)) }
private def authenticate(action: (RepositoryInfo) => Any) = { private def authenticate(action: => Any) = {
{ {
val paths = request.getRequestURI.substring(request.getContextPath.length).split("/") val paths = request.getRequestURI.substring(request.getContextPath.length).split("/")
context.loginAccount match { context.loginAccount match {