summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/context.go11
-rw-r--r--web/params.go8
2 files changed, 19 insertions, 0 deletions
diff --git a/web/context.go b/web/context.go
index 711d241ae..8f79421e5 100644
--- a/web/context.go
+++ b/web/context.go
@@ -490,6 +490,17 @@ func (c *Context) RequireRoleId() *Context {
return c
}
+func (c *Context) RequireSchemeId() *Context {
+ if c.Err != nil {
+ return c
+ }
+
+ if len(c.Params.SchemeId) != 26 {
+ c.SetInvalidUrlParam("scheme_id")
+ }
+ return c
+}
+
func (c *Context) RequireRoleName() *Context {
if c.Err != nil {
return c
diff --git a/web/params.go b/web/params.go
index e97b206ab..2c30ba4c0 100644
--- a/web/params.go
+++ b/web/params.go
@@ -47,6 +47,8 @@ type Params struct {
ActionId string
RoleId string
RoleName string
+ SchemeId string
+ Scope string
Page int
PerPage int
LogsPerPage int
@@ -167,6 +169,12 @@ func ParamsFromRequest(r *http.Request) *Params {
params.RoleName = val
}
+ if val, ok := props["scheme_id"]; ok {
+ params.SchemeId = val
+ }
+
+ params.Scope = query.Get("scope")
+
if val, err := strconv.Atoi(query.Get("page")); err != nil || val < 0 {
params.Page = PAGE_DEFAULT
} else {