Versions in this module Expand all Collapse all v0 v0.1.6 Aug 8, 2022 v0.1.5 Jul 4, 2022 v0.1.4 Jun 22, 2022 v0.1.3 Apr 8, 2022 v0.1.2 Mar 15, 2022 Changes in this version + var ErrPolicyNotFound error = errors.New("找不到权限信息") + func GetAllPolicy() map[string][]Policy type RolePolicy + Policies []Policy + PolicySub string v0.1.1 Feb 27, 2022 Changes in this version + const ACT_API_ACCESS + const ACT_RES_READ + const ACT_RES_WRITE + const MethodConnect + const MethodDelete + const MethodGet + const MethodHead + const MethodOptions + const MethodPatch + const MethodPost + const MethodPut + const MethodTrace + const OBJ_TYPE_API + const OBJ_TYPE_RES + var ErrNoApiPolicy error = errors.New("接口权限不足") + var ErrNoCustomerInfo error = errors.New("无法获取用户信息") + var IsServerRunning bool + func GetSecurityHandler() gin.HandlerFunc + type Policy struct + Act int8 + ID int + Obj string + ObjType objType + Sub string + func (Policy) TableName() string + type Role struct + Children []Role + Description string + Name string + Parent *Role + ParentId int + RolePolicies []RolePolicy + func (Role) TableName() string + func (r Role) Add() (role Role) + func (r Role) Delete() error + func (r Role) Match(dest *Policy) bool + func (r Role) Update() error + type RolePolicy struct + Policy Policy + PolicyId int + RoleId int + func (RolePolicy) TableName() string + type Router struct + Handler gin.HandlerFunc + Method httpmethod + RelativePath string + SubTag string + func (r Router) Regist() + type SecurityConfig struct + Enable bool + EnableRedisCache bool + func (c SecurityConfig) Load() + type UserRole struct + Role *Role + RoleId int + Uid int + func FindUserRoleByUid(uid int) (urs []UserRole, err error) + func (UserRole) TableName() string