Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CtxGlobal = ContextType("global") CtxApp = ContextType("app") CtxTeam = ContextType("team") CtxUser = ContextType("user") CtxPool = ContextType("pool") CtxIaaS = ContextType("iaas") CtxService = ContextType("service") CtxServiceInstance = ContextType("service-instance") CtxVolume = ContextType("volume") ContextTypes = []ContextType{ CtxGlobal, CtxApp, CtxTeam, CtxPool, CtxIaaS, CtxService, CtxServiceInstance, } )
View Source
var ( ErrRoleNotFound = errors.New("role not found") ErrRoleAlreadyExists = errors.New("role already exists") ErrRoleEventNotFound = errors.New("role event not found") ErrInvalidRoleName = errors.New("invalid role name") ErrInvalidPermissionName = errors.New("invalid permission name") ErrRemoveRoleWithUsers = errors.New("role has users assigned. you must dissociate them before remove the role.") RoleEventUserCreate = &RoleEvent{ Name: "user-create", Context: CtxGlobal, Description: "role added to user when user is created", } RoleEventTeamCreate = &RoleEvent{ Name: "team-create", Context: CtxTeam, Description: "role added to user when a new team is created", } RoleEventMap = map[string]*RoleEvent{ RoleEventUserCreate.Name: RoleEventUserCreate, RoleEventTeamCreate.Name: RoleEventTeamCreate, } )
Functions ¶
This section is empty.
Types ¶
type ContextType ¶
type ContextType string
type ErrPermissionNotAllowed ¶
type ErrPermissionNotAllowed struct { Permission string ContextType ContextType }
func (ErrPermissionNotAllowed) Error ¶
func (e ErrPermissionNotAllowed) Error() string
type ErrPermissionNotFound ¶
type ErrPermissionNotFound struct {
Permission string
}
func (ErrPermissionNotFound) Error ¶
func (e ErrPermissionNotFound) Error() string
type ErrRoleEventWrongContext ¶
func (ErrRoleEventWrongContext) Error ¶
func (e ErrRoleEventWrongContext) Error() string
type PermissionContext ¶
type PermissionContext struct { CtxType ContextType Value string }
Click to show internal directories.
Click to hide internal directories.