Documentation ¶
Index ¶
- Constants
- func ActScope(act string) func(db *gorm.DB) *gorm.DB
- func CheckNameAndAct(scopes ...func(db *gorm.DB) *gorm.DB) bool
- func CreatePerm(ctx iris.Context)
- func CreatenInBatches(db *gorm.DB, perms PermCollection) error
- func DeletePerm(ctx iris.Context)
- func First(ctx iris.Context)
- func GetAll(ctx iris.Context)
- func GetMigration() *gormigrate.Migration
- func GetPermsForRole() ([][]string, error)
- func NameScope(name string) func(db *gorm.DB) *gorm.DB
- func New(routes []map[string]string) *source
- func Party() func(index iris.Party)
- func UpdatePerm(ctx iris.Context)
- type BasePermission
- type PageResponse
- type PermCollection
- type Permission
- type Request
- type Response
Constants ¶
View Source
const TableName = "permissions"
Variables ¶
This section is empty.
Functions ¶
func CheckNameAndAct ¶
CheckNameAndAct 检测权限是否存在
func CreatenInBatches ¶
func CreatenInBatches(db *gorm.DB, perms PermCollection) error
CreatenInBatches 批量加入
func GetMigration ¶
func GetMigration() *gormigrate.Migration
Types ¶
type BasePermission ¶
type BasePermission struct { Name string `gorm:"index:perm_index,unique;not null ;type:varchar(256)" json:"name" validate:"required,gte=4,lte=50"` Act string `gorm:"index:perm_index;type:varchar(256)" json:"act" validate:"required"` DisplayName string `gorm:"type:varchar(256)" json:"displayName"` Description string `gorm:"type:varchar(256)" json:"description"` }
BasePermission 权鉴基础模块
type PageResponse ¶
type PageResponse struct {
Item []*Response
}
Paginate 分页
type PermCollection ¶
type PermCollection []Permission
type Permission ¶
type Permission struct { gorm.Model BasePermission }
Permission 权鉴模块
Click to show internal directories.
Click to hide internal directories.