Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminRoleAsString ¶
func AdminRoleAsString() string
func EmployeeRoleAsString ¶
func EmployeeRoleAsString() string
func NewContext ¶
NewContext returns a copy of parent context with the given Viewer attached with it.
func OwnerRoleAsString ¶
func OwnerRoleAsString() string
func ViewerRole ¶
func ViewerRole() int
func ViewerRoleAsString ¶
func ViewerRoleAsString() string
Types ¶
type Role ¶
type Role int
Role for viewer actions.
const ( Admin Role Owner Employee View )
List of roles.
type UserViewer ¶
type UserViewer struct { Role Role // Attached roles. Scopes []string // Attached businesses for this role Claims map[string]string }
UserViewer describes a user-viewer.
func (*UserViewer) Admin ¶
func (v *UserViewer) Admin() bool
func (*UserViewer) Employee ¶
func (v *UserViewer) Employee() bool
func (*UserViewer) GetUserID ¶
func (v *UserViewer) GetUserID() string
func (*UserViewer) HasScope ¶
func (v *UserViewer) HasScope(scope string) bool
func (*UserViewer) HasScopes ¶
func (v *UserViewer) HasScopes() bool
func (*UserViewer) Owner ¶
func (v *UserViewer) Owner() bool
func (*UserViewer) SetUserID ¶
func (v *UserViewer) SetUserID(id string)
Click to show internal directories.
Click to hide internal directories.