authper

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

This if folk from github.com/casbin/casbin-pg-adapter

Note.

  1. Only support github.com/gocraft/dbr for now version
  2. Only support rbac_with_resource_roles_model for now version
  3. RemoveFilteredPolicy unimplemented

TODO

  1. add test

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasbinRule

type CasbinRule struct {
	ID    string
	PType string `db:"ptype"`
	V0    string
	V1    string
	V2    string
	V3    string
	V4    string
	V5    string
}

CasbinRule represents a rule in Casbin.

func (*CasbinRule) String

func (r *CasbinRule) String() string

type Filter

type Filter struct {
	P []string
	G []string
}

type PGAdapter

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

func NewPGAdapter

func NewPGAdapter(dbConn *dbr.Connection) (*PGAdapter, error)

func (*PGAdapter) AddPolicies

func (a *PGAdapter) AddPolicies(sec string, ptype string, rules [][]string) error

func (*PGAdapter) AddPolicy

func (a *PGAdapter) AddPolicy(sec string, ptype string, rule []string) error

func (*PGAdapter) LoadPolicy

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

func (*PGAdapter) RemoveFilteredPolicy

func (a *PGAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error

func (*PGAdapter) RemovePolicies

func (a *PGAdapter) RemovePolicies(sec string, ptype string, rules [][]string) error

func (*PGAdapter) RemovePolicy

func (a *PGAdapter) RemovePolicy(sec string, ptype string, rule []string) error

func (*PGAdapter) SavePolicy

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

Jump to

Keyboard shortcuts

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