Documentation
¶
Overview ¶
Package access evaluates resource and action permissions for application roles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDenied = errors.New("permission denied")
ErrDenied identifies authorization failures, including empty requests.
Functions ¶
This section is empty.
Types ¶
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
Control holds an application’s resource and action vocabulary.
func New ¶
func New(vocabulary Statements) Control
New defines which resources and actions can be assigned to roles.
func (Control) HasAction ¶
HasAction reports whether the vocabulary declares the resource-action pair.
func (Control) HasResource ¶
HasResource reports whether the vocabulary includes the named resource.
type Match ¶
type Match uint8
Match controls how a group of checks is combined. The zero value requires all.
type Requirement ¶
Requirement checks the named actions on a single resource.
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
Role holds an immutable selection of grants. A role is safe for concurrent use.
type Statements ¶
Statements lists the actions associated with each resource.
func (Statements) AllowsAll ¶
func (s Statements) AllowsAll(request Statements) bool
AllowsAll checks a request in the resource-to-actions map form. It requires every requested resource to have at least one action, and every action to match.