mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-13 08:55:50 +01:00
(refs #464)Add Security sealed trait which is used by plugin
This commit is contained in:
@@ -7,11 +7,8 @@ import java.util.concurrent.atomic.AtomicBoolean
|
||||
import util.Directory._
|
||||
import util.ControlUtil._
|
||||
import org.apache.commons.io.FileUtils
|
||||
import util.JGitUtil
|
||||
import org.eclipse.jgit.api.Git
|
||||
import service.RepositoryService.RepositoryInfo
|
||||
import scala.reflect.runtime.currentMirror
|
||||
import scala.tools.reflect.ToolBox
|
||||
import Security._
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,8 +88,8 @@ object PluginSystem {
|
||||
case class PluginRepository(id: String, url: String)
|
||||
case class GlobalMenu(label: String, url: String, icon: String, condition: Context => Boolean)
|
||||
case class RepositoryMenu(label: String, name: String, url: String, icon: String, condition: Context => Boolean)
|
||||
case class Action(path: String, security: String, function: (HttpServletRequest, HttpServletResponse) => Any)
|
||||
case class RepositoryAction(path: String, security: String, function: (HttpServletRequest, HttpServletResponse, RepositoryInfo) => Any)
|
||||
case class Action(path: String, security: Security, function: (HttpServletRequest, HttpServletResponse) => Any)
|
||||
case class RepositoryAction(path: String, security: Security, function: (HttpServletRequest, HttpServletResponse, RepositoryInfo) => Any)
|
||||
case class Button(label: String, href: String)
|
||||
case class JavaScript(filter: String => Boolean, script: String)
|
||||
|
||||
@@ -118,4 +115,3 @@ object PluginSystem {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
11
src/main/scala/plugin/Security.scala
Normal file
11
src/main/scala/plugin/Security.scala
Normal file
@@ -0,0 +1,11 @@
|
||||
package plugin
|
||||
|
||||
object Security {
|
||||
sealed trait Security
|
||||
case class All() extends Security
|
||||
case class Login() extends Security
|
||||
case class Member() extends Security
|
||||
case class Owner() extends Security
|
||||
case class Admin() extends Security
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user