policy

package
v0.0.0-...-6ecc318 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Model  string `envconfig:"CONFIG_MODEL" default:"configs/acl_model.conf"`
	Policy string `envconfig:"CONFIG_POLICY" default:"configs/acl_policy.csv"`
}

func LoadConfigFromEnv

func LoadConfigFromEnv() Config

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewEnforcer

func NewEnforcer(c Config) *Service

func (*Service) IsAllowed

func (s *Service) IsAllowed(sub, obj, act string) bool

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, obj, act string) bool

Jump to

Keyboard shortcuts

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