metathings_identityd2_policy

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CASBIN_BACKEND_DEFAULT_ENFORCER_HANDLER = 0
	CASBIN_BACKEND_POLICY_PTYPE             = "p"
	CASBIN_BACKEND_UNGROUPING_PTYPE         = "g2"
	CASBIN_BACKEND_SUBJECT_PTYPE            = "g2"
	CASBIN_BACKEND_OBJECT_PTYPE             = "g3"
	CASBIN_BACKEND_UNGROUPING               = "ungrouping"
)

Variables

View Source
var (
	ErrPermissionDenied     = errors.New("permission denied")
	ErrUnauthenticated      = errors.New("unauthenticated")
	ErrInvalidBackendDriver = errors.New("invalid backend driver")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Enforce(sub, obj *storage.Entity, act *storage.Action) error
	CreateGroup(*storage.Group) error
	DeleteGroup(*storage.Group) error
	AddSubjectToGroup(*storage.Group, *storage.Entity) error
	RemoveSubjectFromGroup(*storage.Group, *storage.Entity) error
	AddObjectToGroup(*storage.Group, *storage.Entity) error
	RemoveObjectFromGroup(*storage.Group, *storage.Entity) error
	AddRoleToGroup(*storage.Group, *storage.Role) error
	RemoveRoleFromGroup(*storage.Group, *storage.Role) error

	AddRoleToEntity(ent *storage.Entity, rol *storage.Role) error
	RemoveRoleFromEntity(ent *storage.Entity, rol *storage.Role) error
}

func NewBackend

func NewBackend(name string, args ...interface{}) (Backend, error)

type BackendFactory

type BackendFactory func(...interface{}) (Backend, error)

type CasbinBackend

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

func (*CasbinBackend) AddObjectToGroup

func (cb *CasbinBackend) AddObjectToGroup(grp *storage.Group, obj *storage.Entity) error

func (*CasbinBackend) AddRoleToEntity

func (cb *CasbinBackend) AddRoleToEntity(ent *storage.Entity, rol *storage.Role) error

func (*CasbinBackend) AddRoleToGroup

func (cb *CasbinBackend) AddRoleToGroup(grp *storage.Group, rol *storage.Role) error

func (*CasbinBackend) AddSubjectToGroup

func (cb *CasbinBackend) AddSubjectToGroup(grp *storage.Group, sub *storage.Entity) error

func (*CasbinBackend) CreateGroup

func (cb *CasbinBackend) CreateGroup(grp *storage.Group) error

func (*CasbinBackend) DeleteGroup

func (cb *CasbinBackend) DeleteGroup(grp *storage.Group) error

func (*CasbinBackend) Enforce

func (cb *CasbinBackend) Enforce(sub, obj *storage.Entity, act *storage.Action) error

func (*CasbinBackend) RemoveObjectFromGroup

func (cb *CasbinBackend) RemoveObjectFromGroup(grp *storage.Group, obj *storage.Entity) error

func (*CasbinBackend) RemoveRoleFromEntity

func (cb *CasbinBackend) RemoveRoleFromEntity(ent *storage.Entity, rol *storage.Role) error

func (*CasbinBackend) RemoveRoleFromGroup

func (cb *CasbinBackend) RemoveRoleFromGroup(grp *storage.Group, rol *storage.Role) error

func (*CasbinBackend) RemoveSubjectFromGroup

func (cb *CasbinBackend) RemoveSubjectFromGroup(grp *storage.Group, sub *storage.Entity) error

type CasbinBackendOption

type CasbinBackendOption struct {
	EnforcerHandler int32
}

Directories

Path Synopsis
Package mock_metathings_identityd2_policy is a generated GoMock package.
Package mock_metathings_identityd2_policy is a generated GoMock package.

Jump to

Keyboard shortcuts

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