casbin

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(fields ...interface{}) primitive.Group

Filter :

func MustNew

func MustNew(ctx context.Context, table *sqlike.Table) persist.FilteredAdapter

MustNew :

func New

New :

Types

type Adapter

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

Adapter :

func (*Adapter) AddPolicy

func (a *Adapter) AddPolicy(sec string, ptype string, rules []string) error

AddPolicy : adds a policy policy to the storage. This is part of the Auto-Save feature.

func (*Adapter) IsFiltered

func (a *Adapter) IsFiltered() bool

IsFiltered :

func (*Adapter) LoadFilteredPolicy

func (a *Adapter) LoadFilteredPolicy(model model.Model, filter interface{}) error

LoadFilteredPolicy :

func (*Adapter) LoadPolicy

func (a *Adapter) LoadPolicy(model model.Model) error

LoadPolicy :

func (*Adapter) RemoveFilteredPolicy

func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, idx int, values ...string) error

RemoveFilteredPolicy : removes policy rules that match the filter from the storage. This is part of the Auto-Save feature.

func (*Adapter) RemovePolicy

func (a *Adapter) RemovePolicy(sec string, ptype string, rules []string) error

RemovePolicy : removes a policy policy from the storage. This is part of the Auto-Save feature.

func (*Adapter) SavePolicy

func (a *Adapter) SavePolicy(model model.Model) error

SavePolicy : saves all policy rules to the storage.

type Policy

type Policy struct {
	PType string `sqlike:",size=3"`
	V0    string
	V1    string
	V2    string `sqlike:",size=50"`
	V3    string `sqlike:",size=50"`
	V4    string `sqlike:",size=50"`
	V5    string `sqlike:",size=50"`
}

Policy :

Jump to

Keyboard shortcuts

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