Documentation
¶
Index ¶
- Constants
- func CanAccess(user *model.User, database *model.Database) bool
- func CanReadDeployment(user *model.User, deployment *model.Deployment) bool
- func CanUnlock(user *model.User, database *model.Database) bool
- func CanWriteDeployment(user *model.User, deployment *model.Deployment) bool
- func DataBinder(c *gin.Context, req interface{}) error
- func GetPathParameter(c *gin.Context, parameter string) (uint, bool)
- func GetTokenFromRequest(c *gin.Context) (string, error)
- func GetUserFromContext(ctx context.Context) (*model.User, error)
- func IsAdministrator(user *model.User) bool
- func IsGroupAdministrator(groupName string, groups []model.Group) bool
- func RegisterValidation() error
Constants ¶
View Source
const AdministratorGroupName = "administrators"
Variables ¶
This section is empty.
Functions ¶
func CanAccess ¶
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 CanWriteDeployment ¶
func CanWriteDeployment(user *model.User, deployment *model.Deployment) bool
func DataBinder ¶
func GetUserFromContext ¶
GetUserFromContext returns the User value stored in ctx, if any otherwise it returns an error.
func IsAdministrator ¶
func RegisterValidation ¶
func RegisterValidation() error
RegisterValidation Inspiration: https://blog.logrocket.com/gin-binding-in-go-a-tutorial-with-examples/
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.