auth

package
v0.0.0-...-3f89aaf Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

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

Authorizer is a wrapper for a casbin enforcer.

func New

func New(model, policy string) *Authorizer

New instantiates a new authorizer using the model and policy specified in the files stored in the given model and policy file paths.

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(
	subject string,
	object string,
	action string,
) error

Authorize verifies if a given subject is permitted to run a given action on a given object.

Jump to

Keyboard shortcuts

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