rbac

package
v0.0.0-...-55c8b89 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeRole = iota + 1
	TypePermission
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	ID          string    `db:"id" json:"id"`
	Name        string    `db:"name" json:"name"`
	CreatedAt   time.Time `db:"created_at" json:"created_at"`
	UpdatedAt   time.Time `db:"updated_at" json:"updated_at"`
	Permissions []Item    `db:"permissions" json:"permissions"`
}

type Item

type Item struct {
	ID        string    `db:"id" json:"id"`
	GroupID   string    `db:"group_id" json:"group_id"`
	Name      string    `db:"name" json:"name"`
	Type      int       `db:"item_type" json:"item_type"`
	Reserved  bool      `db:"reserved" json:"reserved"`
	Obj       string    `db:"obj" json:"obj"`
	Act       string    `db:"act" json:"act"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

func (Item) IsPermission

func (i Item) IsPermission() bool

func (Item) IsRole

func (i Item) IsRole() bool

Jump to

Keyboard shortcuts

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