roles

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Rules []Rule

Functions

func AddRule

func AddRule(e Entity, a Action, r Role)

func Can

func Can(role Role, a Action, e Entity) bool

Types

type Action

type Action int
const (
	ActionCreate Action = iota
	ActionDelete
	ActionEdit
	ActionView
)

type Entity

type Entity string

type Role

type Role string

func (Role) Equal

func (r Role) Equal(r2 Role) bool

func (*Role) Scan

func (r *Role) Scan(value interface{}) error

func (Role) Value

func (r Role) Value() (driver.Value, error)

type Rule

type Rule struct {
	Role   Role
	Action Action
	Entity Entity
}

Jump to

Keyboard shortcuts

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