Documentation
¶
Overview ¶
Package rbac 简单的 RBAC 权限规则实现
Index ¶
- func DeleteRoleHandle(g *RoleGroup, idName string, ctx *web.Context) web.Responser
- func GetResourcesHandle(g *RoleGroup, ctx *web.Context) web.Responser
- func GetRoleResourcesHandle(g *RoleGroup, idName string, ctx *web.Context) web.Responser
- func GetRolesHandle(g *RoleGroup, _ *web.Context) web.Responser
- func Install(mod *cmfx.Module)
- func PostRolesHandle(g *RoleGroup, ctx *web.Context) web.Responser
- func PutRoleHandle(g *RoleGroup, idName string, ctx *web.Context) web.Responser
- func PutRoleResourcesHandle(g *RoleGroup, idName string, ctx *web.Context) web.Responser
- type RBAC
- type ResourceGroup
- type Role
- type RoleGroup
- type RoleTO
- type RoleVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResourcesHandle ¶
GetResourcesHandle 获取所有的资源信息
func GetRolesHandle ¶
GetRolesHandle 向客户端输出 g 中保存的所有角色列表
func PostRolesHandle ¶
PostRolesHandle 向 g 中添加角色
Types ¶
type ResourceGroup ¶
type ResourceGroup = rbac.ResourceGroup[int64]
type RoleTO ¶
type RoleTO struct {
XMLName struct{} `json:"-" xml:"role" cbor:"-" yaml:"-"`
Name string `json:"name" xml:"name" cbor:"name" yaml:"name" comment:"role name"`
Desc string `json:"description" xml:"description" cbor:"description" yaml:"description" comment:"role description"`
Parent string `json:"parent,omitempty" xml:"parent,attr,omitempty" cbor:"parent,omitempty" yaml:"parent,omitempty" comment:"role parent"`
}
RoleTO 角色信息
func (*RoleTO) Filter ¶
func (r *RoleTO) Filter(v *web.FilterContext)
type RoleVO ¶
type RoleVO struct {
XMLName struct{} `json:"-" xml:"role" cbor:"-" yaml:"-"`
ID string `json:"id,omitempty" xml:"id,attr,omitempty" cbor:"id,omitempty" yaml:"id,omitempty" comment:"role id"`
Name string `json:"name" xml:"name" cbor:"name" yaml:"name" comment:"role name"`
Desc string `json:"description" xml:"description" cbor:"description" yaml:"description" comment:"role description"`
Parent string `json:"parent,omitempty" xml:"parent,attr,omitempty" cbor:"parent,omitempty" yaml:"parent,omitempty" comment:"role parent"`
}
RoleVO 角色信息
Click to show internal directories.
Click to hide internal directories.