auth

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Users = map[string]Login{}

temporary Key is loginname

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HasAnyRole

func HasAnyRole(user *db.PdmUser, roles ...string) bool

HasAnyRole checks if the user has at least one of the given roles (case-insensitive)

func HashPassword

func HashPassword(password string) (string, error)

func IsAdmin

func IsAdmin(user *db.PdmUser) bool

func IsProjectLead

func IsProjectLead(user *db.PdmUser) bool

func IsSeniorDesigner

func IsSeniorDesigner(user *db.PdmUser) bool

func IsValidSession

func IsValidSession(sessionValue string, repo *db.UserRepo) bool

func IsValidUser

func IsValidUser(loginname, password string, repo *db.UserRepo) bool

Types

type Login

type Login struct {
	HashedPassword string
	SessionToke    string
	CSRFToke       string
}

Jump to

Keyboard shortcuts

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