auth

package
v0.0.0-...-2c53574 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT 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
}

func New

func New(model, policy string) *Authorizer

model and policy arguments are paths to the files where we defined the model (which will configure Casbin's authorization mechanism - which in this case will be ACL) and the policy (which is a CSV file containing our ACL table).

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(sub, obj, action string) error

Returns whether the given subject is permitted to run the given action on the given object based on the model and policy used in Casbin's configuration.

Jump to

Keyboard shortcuts

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