rbacutils

package
v2.3.8+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	WILD_MATCH = "*"

	Allow      = TRbacResult("allow")
	OwnerAllow = TRbacResult("owner")
	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
}

type TRbacResult

type TRbacResult string

func (TRbacResult) IsHigherPrivilege

func (result TRbacResult) IsHigherPrivilege(r2 TRbacResult) bool

Jump to

Keyboard shortcuts

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