casbin: github.com/casbin/casbin/effect Index | Files

package effect

import "github.com/casbin/casbin/effect"

Index

Package Files

default_effector.go effector.go

type DefaultEffector Uses

type DefaultEffector struct {
}

DefaultEffector is default effector for Casbin.

func NewDefaultEffector Uses

func NewDefaultEffector() *DefaultEffector

NewDefaultEffector is the constructor for DefaultEffector.

func (*DefaultEffector) MergeEffects Uses

func (e *DefaultEffector) MergeEffects(expr string, effects []Effect, results []float64) (bool, int, error)

MergeEffects merges all matching results collected by the enforcer into a single decision.

type Effect Uses

type Effect int

Effect is the result for a policy rule.

const (
    Allow Effect = iota
    Indeterminate
    Deny
)

Values for policy effect.

type Effector Uses

type Effector interface {
    // MergeEffects merges all matching results collected by the enforcer into a single decision.
    MergeEffects(expr string, effects []Effect, results []float64) (bool, int, error)
}

Effector is the interface for Casbin effectors.

Package effect imports 1 packages (graph) and is imported by 3 packages. Updated 2020-07-04. Refresh now. Tools for package owners.