auth

package
v0.0.0-...-5a23a7a Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(hashedPassword, password string) error

func Encrypt

func Encrypt(source string) (string, error)

Types

type Authz

type Authz struct {
	*casbin.SyncedEnforcer
}

Authz 定义了一个授权器,提供授权功能.

func NewAuthz

func NewAuthz(db *gorm.DB) (*Authz, error)

func (*Authz) Authorize

func (a *Authz) Authorize(sub, obj, act string) (bool, error)

Authorize 授权.

Jump to

Keyboard shortcuts

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