diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/lace.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua index 6d9c0bf..59c5a7a 100644 --- a/lib/gitano/lace.lua +++ b/lib/gitano/lace.lua @@ -209,6 +209,19 @@ local function compile_ruleset(repo, adminsha, globaladminsha) end local function run_ruleset(ruleset, ctx) + -- First check if we're running as bypass + if ctx.as_user == "gitano-bypass" then + log.stdout(i18n.expand("LACE_BYPASS_BANNER_HEADER")) + log.stdout(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) + log.stdout(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) + return "allow", i18n.expand("LACE_BYPASSED") + end + if ctx.as_user == nil and ctx.user == "gitano-bypass" then + log.stdout(i18n.expand("LACE_BYPASS_BANNER_HEADER")) + log.stdout(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) + log.stdout(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) + return "allow", i18n.expand("LACE_BYPASSED") + end return lace.engine.run(ruleset, ctx) end |