mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
Fix OneselfAuthenticator.
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user