Documentation
¶
Index ¶
- Constants
- func NewMongoDBCasbinEnforcer(conf CasbinConfig) *casbin.Enforcer
- type CasbinConfig
- type Handler
- type Service
- func (s *Service) AddPolicy(ctx context.Context, req types.Policy) error
- func (s *Service) GetAllMods(ctx context.Context, id string) ([]string, error)
- func (s *Service) IsAllowed(ctx context.Context, sub string, obj string, act string) bool
- func (s *Service) RemovePolicy(ctx context.Context, idOwner, idCom string) error
- func (s *Service) Validate(ctx context.Context, obj string, act string) error
Constants ¶
View Source
const ( ActionPolicyUpdate = "policy:update" ActionPolicyRead = "policy:read" Object = "policy" )
Variables ¶
This section is empty.
Functions ¶
func NewMongoDBCasbinEnforcer ¶
func NewMongoDBCasbinEnforcer(conf CasbinConfig) *casbin.Enforcer
Types ¶
type CasbinConfig ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(svc service) *Handler
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) GetAllMods ¶
GetAllMods get all moderators of one community
func (*Service) RemovePolicy ¶
Click to show internal directories.
Click to hide internal directories.