Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormPermitRepo ¶
type GormPermitRepo struct {
// contains filtered or unexported fields
}
func NewGormPermitRepo ¶
func NewGormPermitRepo(db *gorm.DB, permit IPermit) *GormPermitRepo
func (*GormPermitRepo) GetPermitsByRole ¶
func (r *GormPermitRepo) GetPermitsByRole(role IRole) (map[int64]string, error)
type GormRoleRepo ¶
type GormRoleRepo struct {
// contains filtered or unexported fields
}
func NewGormRoleRepo ¶
func NewGormRoleRepo(db *gorm.DB, role IRole) *GormRoleRepo
func (*GormRoleRepo) GetRolesByUser ¶
func (r *GormRoleRepo) GetRolesByUser(user IUser) (*[]IRole, error)
根据用户获取角色
type GormUserRepo ¶
type GormUserRepo struct {
// contains filtered or unexported fields
}
func NewGormUserRepo ¶
func NewGormUserRepo(db *gorm.DB, user IUser) *GormUserRepo
func (*GormUserRepo) GetUserById ¶
func (r *GormUserRepo) GetUserById(id int64) (IUser, error)
type IPermitRepo ¶
type IRBACService ¶
type RBACServiceImpl ¶
type RBACServiceImpl struct { SecretKey string // contains filtered or unexported fields }
func NewRBACService ¶
func NewRBACService(userRepo IUserRepo, roleRepo IRoleRepo, permitRepo IPermitRepo, secretKey string) *RBACServiceImpl
func (*RBACServiceImpl) CheckPermission ¶
func (s *RBACServiceImpl) CheckPermission(userId int64, code string) bool
func (*RBACServiceImpl) GetSecretKey ¶
func (s *RBACServiceImpl) GetSecretKey() string
Click to show internal directories.
Click to hide internal directories.