casbin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package casbin implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultModel

func DefaultModel() string

func DefaultPolicy

func DefaultPolicy() []byte

func NewAdapter

func NewAdapter() persist.Adapter

func NewAuthorizer

func NewAuthorizer(cfg *configv1.Security, ss ...Setting) (security.Authorizer, error)

Types

type Authorizer

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

Authorizer is a struct that implements the Authorizer interface.

func (*Authorizer) ApplyDefaults

func (auth *Authorizer) ApplyDefaults() error

func (*Authorizer) Authorized

func (auth *Authorizer) Authorized(ctx context.Context, claims security.UserClaims) (bool, error)

func (*Authorizer) WithConfig

func (auth *Authorizer) WithConfig(config *configv1.AuthZConfig_CasbinConfig) error

type Setting

type Setting = func(*Authorizer)

Setting is a function type for setting the Authenticator.

func WithFileModel

func WithFileModel(path string) Setting

func WithModel

func WithModel(model casbinmodel.Model) Setting

func WithNameModel

func WithNameModel(name string) Setting

func WithPolicyAdapter

func WithPolicyAdapter(policy persist.Adapter) Setting

func WithStringModel

func WithStringModel(str string) Setting

Jump to

Keyboard shortcuts

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