Versions in this module Expand all Collapse all v0 v0.1.0 Jun 11, 2020 Changes in this version + var ErrResourceNamesExist = errors.New("resource names already exist for policy") + func AllowedForUser(user, resource, verb string, names ...string) bool + func BindUserToRole(user string, role *Role) + func SetLogger(l logr.Logger) + type Policies []*Policy + func UserPolicies(user string) Policies + func UserPoliciesForResource(user, resource string) Policies + func (this Policies) AddResourceNames(names ...string) error + func (this Policies) ResourceNameAllowed(name string) bool + func (this Policies) VerbAllowed(verb string) bool + type Policy struct + ResourceNames []string + Resources []string + Verbs []string + func (this *Policy) AddResourceNames(names ...string) error + func (this *Policy) AddVerbs(verbs ...string) error + func (this *Policy) SetResourceNames(names ...string) error + func (this Policy) ResourceNameAllowed(name string) bool + func (this Policy) VerbAllowed(verb string) bool + type Role struct + MappedPolicies map[string]Policies + Name string + Policies Policies + ResourceNames []string + func NewRole(name string, policies ...*Policy) *Role + func (this *Role) AddPolicies(policies ...*Policy) error + func (this Role) Allowed(resource, verb string, names ...string) bool + func (this Role) PoliciesForResource(resource string) Policies