mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-13 08:55:50 +01:00
(refs #464)Add a new parameter to specify request method for plugin actions
This commit is contained in:
@@ -166,8 +166,8 @@ object PluginSystem extends PluginService {
|
||||
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: Security, function: (HttpServletRequest, HttpServletResponse) => Any)
|
||||
case class RepositoryAction(path: String, security: Security, function: (HttpServletRequest, HttpServletResponse, RepositoryInfo) => Any)
|
||||
case class Action(method: String, path: String, security: Security, function: (HttpServletRequest, HttpServletResponse, Context) => Any)
|
||||
case class RepositoryAction(method: String, path: String, security: Security, function: (HttpServletRequest, HttpServletResponse, Context, RepositoryInfo) => Any)
|
||||
case class Button(label: String, href: String)
|
||||
case class JavaScript(filter: String => Boolean, script: String)
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ class ScalaPlugin(val id: String, val version: String,
|
||||
globalMenuList += GlobalMenu(label, url, icon, condition)
|
||||
}
|
||||
|
||||
def addGlobalAction(path: String, security: Security = All())(function: (HttpServletRequest, HttpServletResponse) => Any): Unit = {
|
||||
globalActionList += Action(path, security, function)
|
||||
def addGlobalAction(method: String, path: String, security: Security = All())(function: (HttpServletRequest, HttpServletResponse, Context) => Any): Unit = {
|
||||
globalActionList += Action(method, path, security, function)
|
||||
}
|
||||
|
||||
def addRepositoryAction(path: String, security: Security = All())(function: (HttpServletRequest, HttpServletResponse, RepositoryInfo) => Any): Unit = {
|
||||
repositoryActionList += RepositoryAction(path, security, function)
|
||||
def addRepositoryAction(method: String, path: String, security: Security = All())(function: (HttpServletRequest, HttpServletResponse, Context, RepositoryInfo) => Any): Unit = {
|
||||
repositoryActionList += RepositoryAction(method, path, security, function)
|
||||
}
|
||||
|
||||
def addJavaScript(filter: String => Boolean, script: String): Unit = {
|
||||
|
||||
Reference in New Issue
Block a user