Documentation ¶
Index ¶
- func AddAdmin(adminName string, adminPassword string, isEnable bool) bool
- func AddReSourceToRole(roleId int, resourceId int) bool
- func AddReSourcesToRole(roleId int, resourceIds []string)
- func AddResource(parentId int, name string, controller string, action string, sort int, ...) bool
- func AddRole(name string, isBase bool) bool
- func AddUserToRole(roleId int, userId int) bool
- func AddUsersToRole(roleId int, users []string)
- func DeleteAdmin(id int) bool
- func DeleteResource(id int) bool
- func DeleteResrouce(id int) bool
- func DeleteResrouceByRoleId(roleId int) bool
- func DeleteRole(id int) bool
- func DeleteUserFromRole(roleId int, userId int) bool
- func DeleteUsersFromRole(roleId int, users []string)
- func GetAdminName(ctx *context.Context) string
- func GetAdmins(pageIndex int, pageSize int) (users []orm.ParamsList, totalCount int)
- func GetAllResources() (entitys []orm.ParamsList)
- func GetAllRoles() (entitys []orm.ParamsList)
- func GetCanShowResrouces(adminName string) (entitys []orm.ParamsList)
- func GetDb() *sql.DB
- func GetFirstRoleId() (firstId int)
- func GetGanShowResrouces(adminName string) (entitys []orm.ParamsList)
- func GetInRoleAdmins(roleId int) (entitys []orm.ParamsList)
- func GetNotInRoleAdmins(roleId int) (entitys []orm.ParamsList)
- func GetResource(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
- func GetResources(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
- func GetResroucesInRole(roleId int) (entitys []orm.ParamsList)
- func GetResroucesNotInRole(roleId int) (entitys []orm.ParamsList)
- func GetRoles(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
- func GetSubResourcesCount(resourceId int, entitys []orm.ParamsList) int
- func ISResourceInRole(resourceId int, roleId int) bool
- func IsExistAdmin(adminname string) bool
- func IsExistResource(controller string, action string) bool
- func IsExistRole(name string) bool
- func LogoutAdmin()
- func ValidateAdminLogin(adminname string, password string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResource ¶
func AddResource(parentId int, name string, controller string, action string, sort int, url string, isShow int) bool
添加资源
func GetAdminName ¶
func GetAdmins ¶
func GetAdmins(pageIndex int, pageSize int) (users []orm.ParamsList, totalCount int)
获得后台用户集合
func GetCanShowResrouces ¶
func GetCanShowResrouces(adminName string) (entitys []orm.ParamsList)
根据后台用户名得到可以显示的资源集合
func GetGanShowResrouces ¶
func GetGanShowResrouces(adminName string) (entitys []orm.ParamsList)
func GetInRoleAdmins ¶
func GetInRoleAdmins(roleId int) (entitys []orm.ParamsList)
根据角色id得到在该角色的后台用户的集合
func GetNotInRoleAdmins ¶
func GetNotInRoleAdmins(roleId int) (entitys []orm.ParamsList)
根据角色id得到不在该角色的后台用户的集合
func GetResource ¶
func GetResource(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
获得资源集合
func GetResources ¶
func GetResources(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
获得分页的资源集合
func GetResroucesInRole ¶
func GetResroucesInRole(roleId int) (entitys []orm.ParamsList)
根据角色id得到该角色可以访问的资源
func GetResroucesNotInRole ¶
func GetResroucesNotInRole(roleId int) (entitys []orm.ParamsList)
根据角色id得到该角色可以访问的资源
func GetRoles ¶
func GetRoles(pageIndex int, pageSize int) (entitys []orm.ParamsList, totalCount int)
获得后台用户集合
func GetSubResourcesCount ¶
func GetSubResourcesCount(resourceId int, entitys []orm.ParamsList) int
根据父资源id得到子资源id的数量
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.