userPermission

package
v0.0.0-...-5607d3c Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentOrAdmin

func CurrentOrAdmin(user *model.User, userID uint) bool

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

func CurrentUserIdentical

func CurrentUserIdentical(user *model.User, userID uint) bool

CurrentUserIdentical check that userID is same as current user's ID. TODO: Inline this (won't go do this for us?)

func GetRole

func GetRole(user *model.User) string

func HasAdmin

func HasAdmin(user *model.User) bool

HasAdmin checks that user has an admin permission.

func IsFollower

func IsFollower(user *model.User, currentUser *model.User) bool

func NeedsCaptcha

func NeedsCaptcha(user *model.User) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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