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: 16 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

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

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

func Failure

func Failure(context httpserver.Context, ctx interface{})

Failure .

func FiexdValue

func FiexdValue(v string) func(ctx httpserver.Context) (string, error)

FiexdValue .

func Intercepter

func Intercepter(scope interface{}, id ValueGetter, resource interface{}, action Action) httpserver.Interceptor

Interceptor .

func OrgIDByCluster

func OrgIDByCluster(key string) func(ctx httpserver.Context) (string, error)

OrgIDByCluster .

func OrgIDByClusterWrapper added in v1.1.0

func OrgIDByClusterWrapper(key string) func(ctx context.Context, req interface{}) (string, error)

wrap the new pkg.permission.ValueGetter

func OrgIDByOrgName

func OrgIDByOrgName(key string) func(ctx httpserver.Context) (string, error)

OrgIDByOrgName .

func OrgIDFromHeader

func OrgIDFromHeader() func(ctx httpserver.Context) (string, error)

OrgIDFromHeader .

func OrgIDFromQuery

func OrgIDFromQuery(key string) func(ctx httpserver.Context) (string, error)

OrgIDFromQuery .

func PathValue

func PathValue(keys ...string) func(ctx httpserver.Context) (string, error)

PathValue .

func ProjectId

func ProjectId(r *http.Request) string

func ProjectIdFromParams

func ProjectIdFromParams() func(ctx httpserver.Context) (string, error)

func QueryValue

func QueryValue(keys ...string) func(ctx httpserver.Context) (string, error)

QueryValue .

func ScopeIdFromParams

func ScopeIdFromParams(db *table.DB) func(ctx httpserver.Context) (string, error)

func TenantGroupFromParams

func TenantGroupFromParams(db *table.DB) func(ctx httpserver.Context) (string, error)

func Tk

func Tk(r *http.Request) string

func TkFromParams

func TkFromParams(db *table.DB) func(ctx httpserver.Context) (string, error)

Types

type Action

type Action string

Action .

type MonitorPermission

type MonitorPermission struct {
	Name string
}

type Scope

type Scope string

Scope .

type ValueGetter

type ValueGetter func(ctx httpserver.Context) (string, error)

ValueGetter .

Jump to

Keyboard shortcuts

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