handler

package
v0.62.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AdministratorGroupName = "administrators"

Variables

This section is empty.

Functions

func CanAccess

func CanAccess(user *model.User, database *model.Database) bool

TODO: These are all related to databases and as such should probably be moved into the database package

func CanReadDeployment

func CanReadDeployment(user *model.User, deployment *model.Deployment) bool

func CanUnlock

func CanUnlock(user *model.User, database *model.Database) bool

func CanWriteDeployment

func CanWriteDeployment(user *model.User, deployment *model.Deployment) bool

func DataBinder

func DataBinder(c *gin.Context, req interface{}) error

func GetPathParameter

func GetPathParameter(c *gin.Context, parameter string) (uint, bool)

func GetTokenFromRequest

func GetTokenFromRequest(c *gin.Context) (string, error)

func GetUserFromContext

func GetUserFromContext(ctx context.Context) (*model.User, error)

GetUserFromContext returns the User value stored in ctx, if any otherwise it returns an error.

func IsAdministrator

func IsAdministrator(user *model.User) bool

func IsGroupAdministrator

func IsGroupAdministrator(groupName string, groups []model.Group) bool

func RegisterValidation

func RegisterValidation() error

RegisterValidation Inspiration: https://blog.logrocket.com/gin-binding-in-go-a-tutorial-with-examples/

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL