diff options
Diffstat (limited to 'web/context.go')
-rw-r--r-- | web/context.go | 11 |
1 files changed, 11 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 |