rbac

package module
v0.0.0-...-442c822 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2015 License: MIT Imports: 7 Imported by: 0

README

goji-rbac

Role Based Access Control for Goji. Inspired by Yii.

Documentation

Index

Constants

View Source
const MaxCheckRecursionLevel int = 3

Variables

This section is empty.

Functions

func AddItemChild

func AddItemChild(item string, child string) error

func Assign

func Assign(item string, userId string) error

func BatchQuery

func BatchQuery(t ItemType, userIdSet []string) ([][]string, error)

func CheckAccess

func CheckAccess(item string, userId string) (bool, error)

func Configure

func Configure(options *Opts)

func LoadChildren

func LoadChildren(name string) ([]item, error)

func LoadItem

func LoadItem(name string) (*item, error)

func NewItem

func NewItem(t ItemType, name string) *item

func Query

func Query(t ItemType, userId string) ([]string, error)

func RemoveItemChild

func RemoveItemChild(item string, child string) error

func Revoke

func Revoke(item string, userId string) error

func Sync

func Sync(userId string, items []string) error

Types

type ItemType

type ItemType int
const (
	TypeAny ItemType = iota
	TypeRole
	TypeTask
	TypeOperation
)

type Opts

type Opts struct {
	Dbx     *sqlx.DB
	Mux     *web.Mux
	MuxBase string
}

Jump to

Keyboard shortcuts

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