userPermission

package
v0.0.0-...-b754639 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminRequired

func AdminRequired(f func(c *gin.Context)) gin.HandlerFunc

AdminRequired run function when user logged in and user has an admin role.

func AuthRequired

func AuthRequired(f func(c *gin.Context)) gin.HandlerFunc

AuthRequired run function when user logged in.

func CurrentOrAdmin

func CurrentOrAdmin(user *model.User, userId int64) bool

CurrentOrAdmin check that user has admin permission or user is the current user.

func CurrentUserIdentical

func CurrentUserIdentical(c *gin.Context, userId int64) (int, error)

CurrentUserIdentical check that userId is same as current user's Id.

func HasAdmin

func HasAdmin(user *model.User) bool

HasAdmin checks that user has an admin permission.

Types

This section is empty.

Jump to

Keyboard shortcuts

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