permission

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

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