add preemtive permission handlers

Signed-off-by: RonniSkansing <rskansing@gmail.com>
This commit is contained in:
RonniSkansing committed 2026-10-01 20:25:18 +02:00
1 parent 52c57808ad
commit efea8ce2fc
3 files changed
+40 -5

No files matched your search

+8 -2
View File
@@ -12,10 +12,13 @@ type GeoIP struct {
// GetMetadata returns the available country codes for the filter UI
func (c *GeoIP) GetMetadata(g *gin.Context) {
_, _, ok := c.handleSession(g)
session, _, ok := c.handleSession(g)
if !ok {
return
}
if !c.handleGlobalAuthorization(g, session) {
return
}
codes := ipdata.Get().CountryCodes()
@@ -28,10 +31,13 @@ func (c *GeoIP) GetMetadata(g *gin.Context) {
// Lookup performs a country lookup for the provided IP address
func (c *GeoIP) Lookup(g *gin.Context) {
_, _, ok := c.handleSession(g)
session, _, ok := c.handleSession(g)
if !ok {
return
}
if !c.handleGlobalAuthorization(g, session) {
return
}
ip := g.Query("ip")
if ip == "" {