Documentation
¶
Index ¶
- Constants
- Variables
- func Authorize(r *Roles, p ...Policy) (bool, error)
- type Attribute
- type Attributes
- func (a *Attributes) Add(keyword string, value []byte)
- func (a *Attributes) AddValues(keyword string, values ...[]byte)
- func (a *Attributes) Append(attrs ...*Attribute)
- func (a *Attributes) Clone() *Attributes
- func (a *Attributes) Contains(target *Attributes) bool
- func (a *Attributes) Data() []*Attribute
- func (a *Attributes) Get(keyword string) []byte
- func (a *Attributes) GetAll(keyword string) *Attributes
- type Policy
- type PolicyFunc
- type Role
- type Roles
- type RolesLoader
Constants ¶
View Source
const SuperuserName = "root"
Variables ¶
View Source
var Allow = PolicyFunc(func(r *Roles) (bool, error) { return true, nil })
View Source
var Deny = PolicyFunc(func(r *Roles) (bool, error) { return false, nil })
View Source
var Superuser = New(SuperuserName)
Functions ¶
Types ¶
type Attribute ¶
func NewAttribute ¶
func NewAttribute() *Attribute
type Attributes ¶
type Attributes []*Attribute
func NewAttributes ¶
func NewAttributes(a ...*Attribute) *Attributes
func (*Attributes) Add ¶
func (a *Attributes) Add(keyword string, value []byte)
func (*Attributes) AddValues ¶
func (a *Attributes) AddValues(keyword string, values ...[]byte)
func (*Attributes) Append ¶
func (a *Attributes) Append(attrs ...*Attribute)
func (*Attributes) Clone ¶
func (a *Attributes) Clone() *Attributes
func (*Attributes) Contains ¶
func (a *Attributes) Contains(target *Attributes) bool
func (*Attributes) Data ¶
func (a *Attributes) Data() []*Attribute
func (*Attributes) Get ¶
func (a *Attributes) Get(keyword string) []byte
func (*Attributes) GetAll ¶
func (a *Attributes) GetAll(keyword string) *Attributes
type PolicyFunc ¶
type Role ¶
type Role struct {
Name string
Attributes *Attributes
}
type RolesLoader ¶
Click to show internal directories.
Click to hide internal directories.