Documentation ¶
Index ¶
- func AuthenticityToken(context router.Context) error
- func AuthenticityTokenFilter(c router.Context) error
- func CurrentUser(context router.Context) *users.User
- func CurrentUserFilter(c router.Context) error
- func Path(c router.Context) error
- func Resource(c router.Context, r ResourceModel) error
- func ResourceAndAuthenticity(c router.Context, r ResourceModel) error
- func Setup(s *server.Server)
- type ResourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticityToken ¶
AuthenticityToken checks the token in the current request
func AuthenticityTokenFilter ¶
AuthenticityTokenFilter sets the authenticity token on the context and on the cookie
func CurrentUser ¶
CurrentUser returns the saved user (or an empty anon user) for the current session cookie Strictly speaking this should be authenticate.User
func CurrentUserFilter ¶
CurrentUserFilter returns a filter function which sets the current user on the context
func Resource ¶
func Resource(c router.Context, r ResourceModel) error
Resource authorises the path and resource for the current user if model is nil it is ignored and permission granted
func ResourceAndAuthenticity ¶
func ResourceAndAuthenticity(c router.Context, r ResourceModel) error
ResourceAndAuthenticity authorises the path and resource for the current user
Types ¶
type ResourceModel ¶
ResourceModel defines the interface for models passed to authorise.Resource
Click to show internal directories.
Click to hide internal directories.