permission

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: AGPL-3.0 Imports: 17 Imported by: 2 modules, 2 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

View Source
const (
	ScopeSys                   = "sys"
	ScopeOrg                   = "org"
	ScopeProject               = "project"
	ScopeApp                   = "app"
	ScopePublisher             = "publisher"
	ScopeMicroService          = "micro_service"
	MonitorProjectAlert string = "monitor_project_alert"
)

Scope values

View Source
const (
	ActionCreate  = "CREATE"
	ActionDelete  = "DELETE"
	ActionUpdate  = "UPDATE"
	ActionGet     = "GET"
	ActionList    = "LIST"
	ActionOperate = "OPERATE"
)

Action values

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action .

type Interface

type Interface interface {
	Check(perms ...*Permission) transport.ServiceOption
}

Interface .

type Permission

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

Permission .

func Method

func Method(method interface{}, scope, resource interface{}, action Action, id ValueGetter) *Permission

Method .

func NoPermMethod

func NoPermMethod(method interface{}) *Permission

NoPermMethod 。

func (*Permission) String

func (p *Permission) String() string

type Scope

type Scope string

Scope .

type ValueGetter

type ValueGetter func(ctx context.Context, req interface{}) (string, error)

ValueGetter .

func FieldValue

func FieldValue(field string) ValueGetter

FieldValue .

func FiexdValue

func FiexdValue(v string) ValueGetter

FiexdValue .

func HeaderValue

func HeaderValue(key string) ValueGetter

HeaderValue

func OrgIDValue

func OrgIDValue() ValueGetter

OrgIDValue

Jump to

Keyboard shortcuts

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