Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PermissionInjectorMiddleware ¶
func PermissionInjectorMiddleware(permission Permission) func(next http.Handler) http.Handler
PermissionInjectorMiddleware injects the permission into the context
Types ¶
type Permission ¶
func PermissionFromContext ¶
func PermissionFromContext(ctx context.Context) (Permission, error)
type Role ¶
type Role struct { Name string Permissions []Permission }
func SetupRoles ¶
func SetupRoles() []Role
func (*Role) HasPermission ¶
func (r *Role) HasPermission(p Permission) bool
func (*Role) HasPermissions ¶
func (r *Role) HasPermissions(perms []Permission) bool
Click to show internal directories.
Click to hide internal directories.