rbac

package
v1.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(prefix string, fn Fn) gin.HandlerFunc

Middleware rbac verification

Types

type AclFn

type AclFn interface {
	Get(ctx context.Context, key string, policy string) *hashset.Set
}

type Fn

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

type RoleFn

type RoleFn interface {
	Get(ctx context.Context, keys []string, mode RoleMode) *hashset.Set
}

type RoleMode

type RoleMode int
const (
	RoleAcl      RoleMode = 0
	RoleResource RoleMode = 1
)

type Scope

type Scope struct {
	UID  interface{}
	Data map[string]interface{}
}

type UserFn

type UserFn interface {
	Get(ctx context.Context, uid interface{}) map[string]interface{}
}

Jump to

Keyboard shortcuts

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