first landing of the Find page, including the four tabs and session memory of the selected tab

This commit is contained in:
2025-10-19 17:12:53 -06:00
parent 13644f4ecb
commit 89da7e8456
5 changed files with 311 additions and 1 deletions
+19
View File
@@ -61,6 +61,9 @@ type AmContext interface {
SetRC(int)
GetScratch(string) any
SetScratch(string, any)
GetSession(string) any
SetSession(string, any)
IsSession(string) bool
TestPermission(string) bool
URLParam(string) string
URLParamInt(string) (int, error)
@@ -357,6 +360,22 @@ func (c *amContext) SetScratch(name string, val any) {
c.scratchpad[name] = val
}
// GetSession returns a session variable.
func (c *amContext) GetSession(name string) any {
return c.session.Values["x."+name]
}
// SetSession sets a session variable.
func (c *amContext) SetSession(name string, value any) {
c.session.Values["x."+name] = value
}
// IsSession tests to see whether a session value is set.
func (c *amContext) IsSession(name string) bool {
_, ok := c.session.Values["x."+name]
return ok
}
// TestPermission tests the current user against permissions.
func (c *amContext) TestPermission(perm string) bool {
return database.AmTestPermission(perm, c.effectiveLevel)