Documentation ¶
Index ¶
- Constants
- func SetCurrentAuthUser(u *AuthUser, r *http.Request) (modified *http.Request)
- func SetCurrentUser(u *User, r *http.Request) (modified *http.Request)
- type Action
- type Actions
- func (a Actions) Append(actions ...Action) (modified Actions)
- func (a Actions) AsNewlines() (newlines string)
- func (a Actions) FilterKnown(other Actions) (known Actions)
- func (a Actions) FilterUnknown(other Actions) (unknown Actions)
- func (a Actions) Has(action Action) (present bool)
- func (a Actions) HasSubject(subject string) (present bool)
- func (a Actions) HasVerb(verb string) (present bool)
- func (a Actions) Len() int
- func (a Actions) String() (s string)
- type AuthProvider
- type AuthUser
- type AuthUserApi
- type AuthUserManager
- type AuthUserProvider
- type Group
- type Groups
- func (g Groups) Append(groups ...Group) (modified Groups)
- func (g Groups) AppendString(names ...string) (modified Groups)
- func (g Groups) AsNewlines() (newlines string)
- func (g Groups) Has(group Group) (present bool)
- func (g Groups) Len() int
- func (g Groups) Remove(groups ...Group) (modified Groups)
- func (g Groups) String() (s string)
- type GroupsManager
- type GroupsProvider
- type Manager
- type SecretsProvider
- type User
- type UserActionsProvider
- type UserManager
- type UserProvider
- type UsersManager
Constants ¶
View Source
const ( UserSignupSignal signaling.Signal = "user-signup" UserLoginSignal signaling.Signal = "user-login" UserLoadedSignal signaling.Signal = "user-loaded" )
View Source
const CurrentAuthUserKey beContext.RequestKey = "current-auth-user"
View Source
const CurrentUserKey beContext.RequestKey = "current-user"
Variables ¶
This section is empty.
Functions ¶
func SetCurrentAuthUser ¶ added in v0.2.0
Types ¶
type Action ¶ added in v0.2.0
type Action string
Action is a kebab-cased name consisting of a verb, a subject (feature.Tag) and one or more additional details, separated by periods. For example: the action `view_fs-content_page` has a verb of "view", a subject of "fs-content" and one additional detail of "page". Details are individually converted to kebab-case and joined with hyphens, ie: `view_fs-content_page.search`
func ParseAction ¶ added in v0.2.0
type Actions ¶ added in v0.2.0
type Actions []Action
Actions are the collection of one or more groups
func NewActionsFromStringNL ¶ added in v0.2.0
func NewActionsFromStrings ¶ added in v0.2.0
func ParseActions ¶ added in v0.2.0
func (Actions) AsNewlines ¶ added in v0.2.0
func (Actions) FilterKnown ¶ added in v0.2.0
func (Actions) FilterUnknown ¶ added in v0.2.0
func (Actions) HasSubject ¶ added in v0.2.0
type AuthProvider ¶
type AuthUser ¶ added in v0.2.0
type AuthUser struct { RID string `json:"real-id"` EID string `json:"enjin-id"` Name string `json:"name"` Email string `json:"email"` Image string `json:"image"` Origin string `json:"origin"` Context beContext.Context `json:"context"` }
func GetCurrentAuthUser ¶ added in v0.2.0
type AuthUserApi ¶ added in v0.2.0
type AuthUserManager ¶ added in v0.2.0
type AuthUserManager interface { // NewAuthUser constructs a new AuthUser instance and saves it to the // userbase NewAuthUser(rid, name, email, picture, audience string, attributes map[string]interface{}) (user *AuthUser, err error) // SetAuthUser writes the given User to the system SetAuthUser(user *AuthUser) (err error) // RemoveAuthUser deletes a user from the system RemoveAuthUser(eid string) (err error) }
type AuthUserProvider ¶ added in v0.2.0
type Groups ¶ added in v0.2.0
type Groups []Group
Groups are the collection of one or more groups
func NewGroupsFromStringNL ¶ added in v0.2.0
func NewGroupsFromStrings ¶ added in v0.2.0
func (Groups) AppendString ¶ added in v0.2.0
func (Groups) AsNewlines ¶ added in v0.2.0
type GroupsManager ¶ added in v0.2.0
type GroupsManager interface { // GetGroupActions returns the list of actions associated with group GetGroupActions(group Group) (actions Actions) // UpdateGroup appends the given actions to the group, creating the group // if non exists UpdateGroup(group Group, actions ...Action) (err error) // RemoveGroup deletes the given group from the system. Does not delete any // fallback groups RemoveGroup(group Group) (err error) // AddUserToGroup adds a user to the list of groups given AddUserToGroup(eid string, groups ...Group) (err error) // RemoveUserFromGroup removes a user from each of the given groups RemoveUserFromGroup(eid string, groups ...Group) (err error) }
type GroupsProvider ¶
type Manager ¶ added in v0.2.0
type Manager interface { AuthUserProvider AuthUserManager UserProvider UserManager GroupsProvider GroupsManager }
type SecretsProvider ¶
type User ¶
type User struct { page.Page AuthUser Origin string `json:"origin"` Groups Groups `json:"-"` Actions Actions `json:"-"` }
func GetCurrentUser ¶
func NewUserFromPageMatter ¶ added in v0.2.0
func NewUserFromPageMatter(user *AuthUser, pm *matter.PageMatter, formats types.FormatProvider, enjin beContext.Context) (u *User, err error)
type UserActionsProvider ¶ added in v0.2.0
type UserActionsProvider interface {
UserActions() (list Actions)
}
type UserManager ¶ added in v0.2.0
type UserManager interface { // NewUser constructs a new User instance and adds it to the userbase NewUser(au *AuthUser) (user *User, err error) // SetUser writes the given User to the system SetUser(user *User) (err error) // RemoveUser deletes a user from the system RemoveUser(eid string) (err error) }
type UserProvider ¶ added in v0.2.0
type UsersManager ¶ added in v0.2.0
type UsersManager interface { UserProvider UserManager }
Click to show internal directories.
Click to hide internal directories.