Documentation ¶
Index ¶
- Variables
- func AddPermForRole(id uint, perms casbin.PermsCollection) error
- func Create(req *Request) (uint, error)
- func CreateRole(ctx iris.Context)
- func DeleteRole(ctx iris.Context)
- func First(ctx iris.Context)
- func GetAdminRoleName() string
- func GetAll(ctx iris.Context)
- func GetRoleIds() ([]uint, error)
- func IsAdminRole(id uint) error
- func NameScope(name string) func(db *gorm.DB) *gorm.DB
- func Party() module.WebModule
- func UpdateRole(ctx iris.Context)
- type BaseRole
- type PageResponse
- type ReqPaginate
- type Request
- type Response
- type Role
- type RoleCollection
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRoleNameInvalide = errors.New("角色名称已经被使用")
View Source
var Source = new(source)
Functions ¶
func AddPermForRole ¶
func AddPermForRole(id uint, perms casbin.PermsCollection) error
AddPermForRole
func GetRoleIds ¶
func IsAdminRole ¶
Types ¶
type BaseRole ¶
type BaseRole struct { Name string `gorm:"uniqueIndex;not null; type:varchar(256)" json:"name" validate:"required,gte=4,lte=50" comment:"名称"` DisplayName string `gorm:"type:varchar(256)" json:"displayName" comment:"显示名称"` Description string `gorm:"type:varchar(256)" json:"description" comment:"描述"` }
type ReqPaginate ¶
type Request ¶
type Request struct { BaseRole Perms casbin.PermsCollection `json:"perms"` }
func GetSources ¶
type Response ¶
func FindByName ¶
FindByName
type Role ¶
type Role struct { gorm.Model BaseRole Perms casbin.PermsCollection `gorm:"-" json:"perms"` }
type RoleCollection ¶
type RoleCollection []Request
Click to show internal directories.
Click to hide internal directories.