Files
authorizer/server/utils/validateSuperAdmin.go

16 lines
294 B
Go
Raw Normal View History

package utils
import (
2021-07-23 21:57:44 +05:30
"github.com/authorizerdev/authorizer/server/constants"
"github.com/gin-gonic/gin"
)
func IsSuperAdmin(gc *gin.Context) bool {
2021-07-28 11:53:37 +05:30
secret := gc.Request.Header.Get("x-authorizer-root-secret")
if secret == "" {
return false
}
2021-07-23 21:57:44 +05:30
return secret == constants.ROOT_SECRET
}