Documentation ¶
Overview ¶
* @Description:casbin方法二次封装 * @Author: gphper * @Date: 2021-07-20 20:52:20
Index ¶
- func AddGroup(ptype string, sub string, group string) (bool, error)
- func AddGroups(ptype string, rules [][]string, txs ...*gorm.DB) (bool, error)
- func AddPolice(rules [][]string) (bool, error)
- func Check(sub string, obj string, act string) (bool, error)
- func DelGroups(ptype string, rules [][]string) (ok bool, err error)
- func GetEnforceObj() *casbin.Enforcer
- func GetGroupByUser(username string) ([]string, error)
- func GetGroups() []string
- func GetPoliceByGroup(group string) [][]string
- func GetRols() []string
- func HasObjByGroup(groupname string, obj string, act string) bool
- func PutEnforceObj(en *casbin.Enforcer)
- func RemovePolices(rules [][]string) (bool, error)
- func UpdateGroups(username string, old []string, new []string, tx *gorm.DB) (ok bool, err error)
- func UpdatePolices(groupname string, old []string, new []string, tx *gorm.DB) (ok bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnforceObj ¶
func GetEnforceObj() *casbin.Enforcer
func PutEnforceObj ¶
func PutEnforceObj(en *casbin.Enforcer)
func UpdateGroups ¶
更新用户所属用户组
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.