Documentation
¶
Index ¶
- func CheckSession(r *http.Request) ident.Ident
- func Config()
- func DeleteSession(id string)
- func GetSessionID(id string) ident.Ident
- func NewSession(ident, aspect, display string, groups []string, roles []string, ...) ident.Ident
- type User
- func (u User) GetAspect() string
- func (u User) GetCookie() *http.Cookie
- func (u User) GetDisplay() string
- func (u User) GetGroups() []string
- func (u User) GetIdentity() string
- func (u User) GetMeta() map[string]string
- func (u User) GetRoles() []string
- func (u User) HasGroup(g ...string) bool
- func (u User) HasRole(r ...string) bool
- func (u User) IsActive() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSession ¶
CheckSession is called by ident to lookup the user
func GetSessionID ¶
GetSessionID returns a user ident from cache
Types ¶
type User ¶
type User struct { Ident string `json:"ident"` Aspect string `json:"aspect"` Name string `json:"name"` Active bool `json:"active"` Groups map[string]struct{} `json:"groups"` Roles map[string]struct{} `json:"roles"` Meta map[string]string `json:"meta"` }
User is an ident.Ident
func (User) GetAspect ¶
GetAspect returns the current aspect of user
func (User) GetCookie ¶
GetCookie returns a formated cookie value
func (User) GetDisplay ¶
GetDisplay returns the display name of user
func (User) GetIdentity ¶
GetIdentity returns the identity of user
func (User) GetMeta ¶
GetMeta returns additional meta info for user
func (User) HasGroup ¶
HasGroup returns true if any groups match
func (User) HasRole ¶
HasRole returns true if any roles match
Click to show internal directories.
Click to hide internal directories.