Documentation ¶
Index ¶
- Constants
- func GetPermissionDataFromContext(ctx context.Context, key string) (interface{}, bool)
- func SetPermissionDataFromContext(ctx context.Context, key string, val interface{})
- func WithPermissionDataContext(ctx context.Context) context.Context
- type Action
- type Interface
- type Option
- type Permission
- type Scope
- type ValueGetter
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 ¶
func GetPermissionDataFromContext ¶
GetPermissionDataFromContext .
func SetPermissionDataFromContext ¶
SetPermissionDataFromContext .
Types ¶
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, options ...Option) *Permission
Method .
func (*Permission) String ¶
func (p *Permission) String() string
type ValueGetter ¶
ValueGetter .
Click to show internal directories.
Click to hide internal directories.