Add session variable for user id

This commit is contained in:
Vikram Rangnekar
2019-09-08 01:54:38 -04:00
parent fe4d1107ac
commit 65921d4d42
9 changed files with 81 additions and 57 deletions

View File

@ -147,7 +147,7 @@ const (
type Config struct {
DefaultFilter []string
FilterMap map[string][]string
Blacklist []string
Blocklist []string
KeepArgs bool
}
@ -168,10 +168,10 @@ var expPool = sync.Pool{
}
func NewCompiler(c Config) (*Compiler, error) {
bl := make(map[string]struct{}, len(c.Blacklist))
bl := make(map[string]struct{}, len(c.Blocklist))
for i := range c.Blacklist {
bl[c.Blacklist[i]] = struct{}{}
for i := range c.Blocklist {
bl[c.Blocklist[i]] = struct{}{}
}
fl, err := compileFilter(c.DefaultFilter)
@ -669,6 +669,9 @@ func (com *Compiler) compileArgAction(sel *Select, arg *Arg) error {
if arg.Val.Type != nodeBool {
return fmt.Errorf("value for argument '%s' must be a boolean", arg.Name)
}
if arg.Val.Val == "false" {
sel.Action = 0
}
default:
if arg.Val.Type != nodeVar {