casbin

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "role"

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResource

type ApiResource interface {
	GetPath() string
	GetMethod() string
}

type Casbin

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

func NewGormCasbin

func NewGormCasbin(gormDb *gorm.DB, watch *redis.Config, watchChannel string) *Casbin

func (*Casbin) AddPermissions

func (c *Casbin) AddPermissions(roleId int, apiResource []ApiResource) (bool, error)

func (*Casbin) ClearPermission

func (c *Casbin) ClearPermission(roleId int) (bool, error)

func (*Casbin) Verify

func (c *Casbin) Verify(roleId int, path string, method string) (success bool)

type Config

type Config struct {
}

Jump to

Keyboard shortcuts

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