model_role

package
v0.0.0-...-9e8b3cb Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//RolePermissionAll    = "ROLE_ALL"
	RolePermissionSelect = "ROLE_SELECT"
	RolePermissionCreate = "ROLE_CREATE"
	RolePermissionEdit   = "ROLE_EDIT"
	RolePermissionDelete = "ROLE_DELETE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	Id          int64                         `json:"id,omitempty" bson:"_id,omitempty"`
	Name        string                        `json:"name,omitempty"  bson:"name,omitempty"`
	Alias       string                        `json:"alias,omitempty"  bson:"alias,omitempty"`
	Note        string                        `json:"note,omitempty"  bson:"note,omitempty"`
	CreateTime  int64                         `json:"create_time,omitempty"  bson:"create_time,omitempty"`
	Permissions []model_permission.Permission `json:"permissions,omitempty" bson:"permissions,omitempty"`
	Label       string                        `json:"label,omitempty"  bson:"label,omitempty"`
	PerStrings  []string                      `json:"per_strings,omitempty" bson:"per_strings,omitempty"`
}

角色表,记录公司各种角色,比如:CEO 管理员,开发,开发经理,销售,销售主管,等

func (Role) Exist

func (r Role) Exist() bool

func (Role) FetchTreeList

func (r Role) FetchTreeList(selector interface{}) (results []Role, err error)

func (Role) FindLabelAll

func (r Role) FindLabelAll() ([]Role, error)

func (Role) FindOne

func (r Role) FindOne() (role Role, err error)

func (Role) FindOneTree

func (r Role) FindOneTree(selector interface{}) (role Role, err error)

func (Role) FindPageFilter

func (r Role) FindPageFilter(page, limit int, query, selector interface{}, fields ...string) ([]Role, error)

func (Role) FindPageTreeFilter

func (r Role) FindPageTreeFilter(page, limit int, query, selector interface{}, fields ...string) ([]Role, error)

func (Role) FindSimple

func (r Role) FindSimple(selector interface{}) (role Role, err error)

func (Role) Insert

func (r Role) Insert() error

func (Role) Remove

func (r Role) Remove() error

func (Role) ToJson

func (r Role) ToJson() string

func (Role) TotalCount

func (r Role) TotalCount(query, selector interface{}) (int, error)

func (Role) Update

func (r Role) Update() error

Jump to

Keyboard shortcuts

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