permission

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: AGPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Permission)

Option 定义 Permission 对象配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

type Permission

type Permission struct {
	Bdl *bundle.Bundle
	// contains filtered or unexported fields
}

Permission 权限操作封装

func New

func New(options ...Option) *Permission

New 新建 Permission 实例

func (*Permission) CheckInternalPermission

func (p *Permission) CheckInternalPermission(identityInfo apistructs.IdentityInfo) bool

CheckInternalPermission 鉴权内部服务账户

func (*Permission) CheckPermission

func (p *Permission) CheckPermission(req *apistructs.PermissionCheckRequest) (bool, error)

CheckPermission 鉴权Z

func (*Permission) CheckPublicScope

func (p *Permission) CheckPublicScope(userId string, scopeType apistructs.ScopeType, scopeId int64) (bool, error)

CheckPublicScope Check current scope public

func (*Permission) StateCheckPermission

func (p *Permission) StateCheckPermission(req *apistructs.PermissionCheckRequest) (bool, []string, error)

StateCheckPermission 事件状态Button鉴权

Jump to

Keyboard shortcuts

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