Documentation
¶
Index ¶
- Variables
- type PostPolicy
- func (p PostPolicy) CanCreate(user *models.User) (bool, error)
- func (p PostPolicy) CanDelete(user *models.User, post *models.Post) (bool, error)
- func (p PostPolicy) CanUpdate(user *models.User, post *models.Post) (bool, error)
- func (p PostPolicy) CanViewDetail(_ *models.User, _ *models.Post) (bool, error)
- func (p PostPolicy) CanViewList(_ *models.User) (bool, error)
- type UserPolicy
- func (p UserPolicy) CanCreate(user *models.User) (bool, error)
- func (p UserPolicy) CanDelete(loggedInUser *models.User, user *models.User) (bool, error)
- func (p UserPolicy) CanUpdate(user *models.User, post *models.Post) (bool, error)
- func (p UserPolicy) CanViewDetail(_ *models.User, _ *models.Post) (bool, error)
- func (p UserPolicy) CanViewList(_ *models.User) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewPostPolicy), fx.Provide(NewUserPolicy), )
Functions ¶
This section is empty.
Types ¶
type PostPolicy ¶
type PostPolicy struct { }
func NewPostPolicy ¶
func NewPostPolicy() PostPolicy
func (PostPolicy) CanViewDetail ¶
func (PostPolicy) CanViewList ¶
func (p PostPolicy) CanViewList(_ *models.User) (bool, error)
type UserPolicy ¶
type UserPolicy struct { }
func NewUserPolicy ¶
func NewUserPolicy() UserPolicy
func (UserPolicy) CanViewDetail ¶
func (UserPolicy) CanViewList ¶
func (p UserPolicy) CanViewList(_ *models.User) (bool, error)
Click to show internal directories.
Click to hide internal directories.