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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user