pol

package
v0.0.0-...-86a089b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package pol provides a simple role based access control system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy interface {
	Police(user, action string) error
}

Policy allows users to execute an action or returns an error.

type Rules

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

Rules implements a role base policy.

func NewPolicy

func NewPolicy(def bool) *Rules

func (*Rules) AddMember

func (p *Rules) AddMember(role, group string) *Rules

func (*Rules) AddRole

func (p *Rules) AddRole(name string, def bool) *Rules

func (*Rules) Allow

func (p *Rules) Allow(role, action string) *Rules

func (*Rules) Deny

func (p *Rules) Deny(role, action string) *Rules

func (*Rules) Police

func (p *Rules) Police(user, action string) error

Jump to

Keyboard shortcuts

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