Skip /js/ in the Access Gate and set denied-page CSP so Denied UI can render.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Konrad Neitzel
2026-08-28 12:39:47 +02:00
co-authored by Cursor
parent 198ef0e204
commit 984b0c2335
7 changed files with 134 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
package gonexapp
import "testing"
func TestTopMenuAdminRequired(t *testing.T) {
tests := []struct {
env string
defAdmin bool
want string
}{
{"", true, "1"},
{"", false, "0"},
{"1", true, "1"},
{"0", true, "0"},
{" 1 ", true, "1"},
{"yes", true, "1"},
{"yes", false, "0"},
{"2", true, "1"},
}
for _, tc := range tests {
if got := TopMenuAdminRequired(tc.env, tc.defAdmin); got != tc.want {
t.Errorf("TopMenuAdminRequired(%q, %v) = %q, want %q", tc.env, tc.defAdmin, got, tc.want)
}
}
}