policies

package
v0.0.0-...-c48e8af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type PostPolicy

type PostPolicy struct {
}

func NewPostPolicy

func NewPostPolicy() PostPolicy

func (PostPolicy) CanCreate

func (p PostPolicy) CanCreate(user *models.User) (bool, error)

func (PostPolicy) CanDelete

func (p PostPolicy) CanDelete(user *models.User, post *models.Post) (bool, error)

func (PostPolicy) CanUpdate

func (p PostPolicy) CanUpdate(user *models.User, post *models.Post) (bool, error)

func (PostPolicy) CanViewDetail

func (p PostPolicy) CanViewDetail(_ *models.User, _ *models.Post) (bool, error)

func (PostPolicy) CanViewList

func (p PostPolicy) CanViewList(_ *models.User) (bool, error)

type UserPolicy

type UserPolicy struct {
}

func NewUserPolicy

func NewUserPolicy() UserPolicy

func (UserPolicy) CanCreate

func (p UserPolicy) CanCreate(user *models.User) (bool, error)

func (UserPolicy) CanDelete

func (p UserPolicy) CanDelete(loggedInUser *models.User, user *models.User) (bool, error)

func (UserPolicy) CanUpdate

func (p UserPolicy) CanUpdate(user *models.User, post *models.Post) (bool, error)

func (UserPolicy) CanViewDetail

func (p UserPolicy) CanViewDetail(_ *models.User, _ *models.Post) (bool, error)

func (UserPolicy) CanViewList

func (p UserPolicy) CanViewList(_ *models.User) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL