permission

package
v1.3.0-rc.0...-0a48220 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

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, org org.ClientInterface) httpserver.Interceptor

Interceptor .

func OrgIDByCluster

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

OrgIDByCluster .

func OrgIDByClusterWrapper

func OrgIDByClusterWrapper(orgServer orgpb.OrgServiceServer, 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