Documentation ¶
Index ¶
- Constants
- type BoxPerm
- type BoxRole
- type BoxUser
- type Logical
- type Model
- type Rule
- type Srv
- func (s *Srv) DelPerm(id []string) error
- func (s *Srv) DeleteRole(id []string) error
- func (s *Srv) DeleteUser(id []string) error
- func (s *Srv) GetListPerm(page, size int) []BoxPerm
- func (s *Srv) GetListRole(page, size int) []BoxRole
- func (s *Srv) GetPerm(id int) *BoxPerm
- func (s *Srv) GetPermCount() int
- func (s *Srv) GetRole(id uint) *BoxRole
- func (s *Srv) GetRoleCount() int
- func (s *Srv) Login(name, pass string) *BoxUser
- func (s *Srv) Perms(u *BoxUser) []string
- func (s *Srv) PostPerm(a BoxPerm) error
- func (s *Srv) PostRole(name, desc string, rid []uint) error
- func (s *Srv) PostUser(name, pass string, id []uint) error
- func (s *Srv) PutPerm(id int, a BoxPerm) error
- func (s *Srv) PutRole(name, desc string, id uint, rid []uint) error
- func (s *Srv) PutUser(id uint, nick, pass, avatar, desc string, rid []uint) error
- func (s *Srv) Register(name, pass string) bool
- func (s *Srv) Roles(u *BoxUser) []string
- func (s *Srv) SelectByID(id uint) *BoxUser
- func (s *Srv) SelectUser(id uint) *UserInfo
- func (s *Srv) SelectUserList(page, size int) []UserInfo
- func (s *Srv) SelectUsertotal() int
- type Type
- type UserInfo
Constants ¶
View Source
const ( TypeRole = iota TypePerm LogicalOR = iota LogicalAND )
enum
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoxPerm ¶
type BoxPerm struct { gorm.Model Roles []BoxRole `gorm:"many2many:box_role_perms;"` Name string `gorm:"not null;unique"` Desc string `gorm:"not null"` }
BoxPerm Model
type BoxRole ¶
type BoxRole struct { gorm.Model Users []BoxUser `gorm:"many2many:box_user_roles;"` Perms []BoxPerm `gorm:"many2many:box_role_perms;"` Name string `gorm:"not null;unique"` Desc string `gorm:"not null"` }
BoxRole Model
type BoxUser ¶
type BoxUser struct { gorm.Model Roles []BoxRole `gorm:"many2many:box_user_roles;"` Name string `gorm:"not null;unique"` Nick string `gorm:"not null;unique"` Avatar string `gorm:"not null"` Desc string `gorm:"not null"` Pass string `gorm:"not null"` }
BoxUser Model
Click to show internal directories.
Click to hide internal directories.