datapermctx

package
v1.4.10-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCustomDeptFromCtx

func GetCustomDeptFromCtx(ctx context.Context) ([]uint64, error)

GetCustomDeptFromCtx returns custom department ids from context

func GetFilterFieldFromCtx

func GetFilterFieldFromCtx(ctx context.Context) (string, error)

GetFilterFieldFromCtx returns filter field from context

func GetScopeFromCtx

func GetScopeFromCtx(ctx context.Context) (uint8, error)

GetScopeFromCtx returns data scope from context.

func WithCustomDeptContext

func WithCustomDeptContext(ctx context.Context, deptIds string) context.Context

WithCustomDeptContext returns context with custom department ids

func WithFilterFieldContext

func WithFilterFieldContext(ctx context.Context, filterField string) context.Context

WithFilterFieldContext returns context with filter field

func WithScopeContext

func WithScopeContext(ctx context.Context, scope string) context.Context

WithScopeContext returns context with data scope

Types

type DataPermKey

type DataPermKey string
const (
	// ScopeKey is the key to store data scope
	ScopeKey DataPermKey = "data-perm-scope"

	// CustomDeptKey is the key to store custom department ids
	CustomDeptKey DataPermKey = "data-perm-custom-dept"

	// FilterFieldKey is the key to store filter field
	FilterFieldKey DataPermKey = "data-perm-filter-field"
)

Jump to

Keyboard shortcuts

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