roles

package
v0.0.0-...-1489327 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPermission

func AddPermission(upd Permissions) error

func AddRole

func AddRole(upd Roles) error

func AddRolePermission

func AddRolePermission(upd RolePermission) error

func AddRolesUser

func AddRolesUser(upd RolesUser) error

func CountPermission

func CountPermission(condArr map[string]string) int64

func CountRole

func CountRole(condArr map[string]string) int64

func DeletePermission

func DeletePermission(ids string) error

func DeleteRole

func DeleteRole(ids string) error

func DeleteRolePermission

func DeleteRolePermission(id int64) error

func DeleteRolePermissionForRoleid

func DeleteRolePermissionForRoleid(roleid int64) error

func DeleteRolesUser

func DeleteRolesUser(id int64) error

func GetPermissiontName

func GetPermissiontName(id int64) string

func UpdatePermission

func UpdatePermission(id int64, upd Permissions) error

func UpdateRole

func UpdateRole(id int64, upd Roles) error

func UpdateRolesUser

func UpdateRolesUser(upd RolesUser) error

Types

type Permissions

type Permissions struct {
	Id       int64  `orm:"pk;column(id);"`
	Parentid int64  `orm:"column(parent_id)"`
	Name     string `orm:"column(name)"`
	EName    string `orm:"column(ename)"`
	Url      string `orm:"column(url)"`
	Icon     string `orm:"column(icon)"`
	Nav      int    `orm:"column(is_nav)"`
	IsShow   int    `orm:"column(is_show)"`
	Sort     int    `orm:"column(sort)"`
}

func GetAuthList

func GetAuthList(page, pageSize int, filters ...interface{}) ([]*Permissions, int64)

func GetPermission

func GetPermission(id int64) (Permissions, error)

func ListParentPermission

func ListParentPermission() (num int64, err error, ops []Permissions)

func ListPermission

func ListPermission(condArr map[string]string, page int, offset int) (num int64, err error, ops []Permissions)

func ListRoleUserPermission

func ListRoleUserPermission(roleid string) (num int64, err error, ops []Permissions)

func (*Permissions) TableName

func (this *Permissions) TableName() string

type RolePermission

type RolePermission struct {
	Id           int64 `orm:"pk;"`
	Roleid       int64 `orm:"column(role_id)"`
	Permissionid int64 `orm:"column(permission_id)"`
}

func ListRolePermission

func ListRolePermission(roleid int64) (ops []RolePermission)

func (*RolePermission) TableName

func (this *RolePermission) TableName() string

type Roles

type Roles struct {
	Id      int64 `orm:"pk;column(id);"`
	Name    string
	Summary string
	Created int64
	Changed int64
}

func GetRole

func GetRole(id int64) (Roles, error)

func ListRole

func ListRole(condArr map[string]string, page int, offset int) (num int64, err error, ops []Roles)

func ListRoleAll

func ListRoleAll() (num int64, err error, ops []Roles)

func (*Roles) TableName

func (this *Roles) TableName() string

type RolesUser

type RolesUser struct {
	Id     int64 `orm:"pk;auto"`
	Roleid int64 `orm:"column(role_id)"`
	Userid int64 `orm:"column(user_id)"`
}

func GetRoleIdByUserId

func GetRoleIdByUserId(userid int64) (err error, roleUser RolesUser)

func ListRolesUser

func ListRolesUser(roleid int64, page, offset int) (ops []RolesUser)

func (*RolesUser) TableName

func (this *RolesUser) TableName() string

type RolesUserName

type RolesUserName struct {
	Id       int64
	Userid   int64
	Realname string
	Roleid   int64
}

func ListRolesUserAndName

func ListRolesUserAndName(roleid int64) (num int64, err error, user []RolesUserName)

type Urls

type Urls struct {
	Id       int64
	ParentId int64
	Name     string
	EName    string
	Url      string
	Icon     string
	Nav      int
	IsShow   int
	Sort     int
	IsActive int
}

func GetLeftNavLevel1

func GetLeftNavLevel1(roleid string, url string) (num int64, err error, ops []Urls)

func GetLeftNavLevel2

func GetLeftNavLevel2(roleid string, url string) (num int64, err error, ops []Urls)

Jump to

Keyboard shortcuts

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