package authentication import ( "errors" "fmt" "git.devices.local/mawas/golang-api-skeleton/lib/response" "github.com/gin-gonic/gin" ) // Authorized blocks unauthorized requestors func Authorized(c *gin.Context) { var resp response.Envelope userID, exists := c.Get("userID") if !exists { c.AbortWithStatusJSON(403, resp.AppendError(errors.New("unauthorized"))) return } fmt.Println("permission check", userID) // TODO add cache perm check here }