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,27 @@
|
||||
package gonexapp
|
||||
|
||||
import "strings"
|
||||
|
||||
// EnvTopMenuAdminRequired is the conventional deploy env name for Top Menu visibility.
|
||||
// Declare it in the ExApp info.xml environment-variables section.
|
||||
const EnvTopMenuAdminRequired = "TOP_MENU_ADMIN_REQUIRED"
|
||||
|
||||
// DefaultTopMenuAdminRequired is used when TOP_MENU_ADMIN_REQUIRED is unset or invalid.
|
||||
const DefaultTopMenuAdminRequired = true
|
||||
|
||||
// TopMenuAdminRequired returns "1" or "0" for the AppAPI top-menu OCS adminRequired field.
|
||||
// Only "0" and "1" are accepted; any other value falls back to defaultAdminRequired.
|
||||
// An empty envValue means unset and also uses defaultAdminRequired.
|
||||
func TopMenuAdminRequired(envValue string, defaultAdminRequired bool) string {
|
||||
switch strings.TrimSpace(envValue) {
|
||||
case "1":
|
||||
return "1"
|
||||
case "0":
|
||||
return "0"
|
||||
default:
|
||||
if defaultAdminRequired {
|
||||
return "1"
|
||||
}
|
||||
return "0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user