Documentation ¶
Overview ¶
Package permset provides primitives for permission management.
Index ¶
- func NewContext(ctx context.Context, permset Permset) context.Context
- type Perm
- type Permset
- func (ps *Permset) Add(perms ...Perm)
- func (ps *Permset) Contains(perm Perm) bool
- func (ps *Permset) ContainsAll(perms ...Perm) bool
- func (ps *Permset) ContainsNone(perms ...Perm) bool
- func (ps *Permset) ContainsSome(perms ...Perm) bool
- func (ps *Permset) Perms() []Perm
- func (ps *Permset) Remove(perms ...Perm)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Permset ¶
type Permset struct {
// contains filtered or unexported fields
}
Permset represents a set of permissions.
func FromContext ¶
FromContext receives a context and returns the permset in it.
func (*Permset) Contains ¶
Contains receives single Perm and returns true if the permset contains it.
func (*Permset) ContainsAll ¶
ContainsAll returns true if the permset contains all received Perms.
func (*Permset) ContainsNone ¶
ContainsNone returns true if the permset contains none one of the received Perms.
func (*Permset) ContainsSome ¶
ContainsSome returns true if the permset contains any one or more of the received Perms.
Click to show internal directories.
Click to hide internal directories.