model

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TablenamePrefix = "rbac_"

Functions

This section is empty.

Types

type Permission

type Permission struct {
	sqlx.Model
	Name        string `json:"name"`
	Description string `json:"description"`
}

func (Permission) TableColumns

func (perm Permission) TableColumns(db *x.DB) []string

func (Permission) TableName

func (Permission) TableName() string

type Role

type Role struct {
	sqlx.Model
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Permissions []*Permission `json:"permissions" db:"-"`
}

func (Role) TableColumns

func (r Role) TableColumns(db *x.DB) []string

func (Role) TableName

func (Role) TableName() string

type RoleWithInheritances

type RoleWithInheritances struct {
	Role  int64
	Based int64 `db:"based"`
}

func (RoleWithInheritances) TableColumns

func (rwp RoleWithInheritances) TableColumns(_ *x.DB) []string

func (RoleWithInheritances) TableName

func (rwp RoleWithInheritances) TableName() string

type RoleWithPermissions

type RoleWithPermissions struct {
	Role int64
	Perm int64
}

func (RoleWithPermissions) TableColumns

func (rwp RoleWithPermissions) TableColumns(_ *x.DB) []string

func (RoleWithPermissions) TableName

func (rwp RoleWithPermissions) TableName() string

type SubjectWithRoles

type SubjectWithRoles struct {
	Subject int64
	Role    int64
}

func (SubjectWithRoles) TableColumns

func (swr SubjectWithRoles) TableColumns(_ *x.DB) []string

func (SubjectWithRoles) TableName

func (swr SubjectWithRoles) TableName() string

Jump to

Keyboard shortcuts

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