rbacutils

package
v2.3.16+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WILD_MATCH = "*"

	AdminAllow = TRbacResult("allow")
	OwnerAllow = TRbacResult("owner")
	UserAllow  = TRbacResult("user")
	GuestAllow = TRbacResult("guest")
	Deny       = TRbacResult("deny")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SRbacPolicy

type SRbacPolicy struct {
	Condition string
	IsAdmin   bool
	Rules     []SRbacRule
}

func (*SRbacPolicy) Allow

func (policy *SRbacPolicy) Allow(userCred jsonutils.JSONObject, service, resource, action string, extra ...string) TRbacResult

func (*SRbacPolicy) Decode

func (policy *SRbacPolicy) Decode(policyJson jsonutils.JSONObject) error

func (*SRbacPolicy) Encode

func (policy *SRbacPolicy) Encode() (jsonutils.JSONObject, error)

func (*SRbacPolicy) Explain

func (policy *SRbacPolicy) Explain(request [][]string) [][]string

func (*SRbacPolicy) GetMatchRule

func (policy *SRbacPolicy) GetMatchRule(service string, resource string, action string, extra ...string) *SRbacRule

type SRbacRule

type SRbacRule struct {
	Service  string
	Resource string
	Action   string
	Extra    []string
	Result   TRbacResult
}

func CompactRules

func CompactRules(rules []SRbacRule) []SRbacRule

type TRbacResult

type TRbacResult string

func (TRbacResult) StricterThan

func (r1 TRbacResult) StricterThan(r2 TRbacResult) bool

func (TRbacResult) Strictness

func (r TRbacResult) Strictness() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL