summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-30 15:38:15 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-30 15:38:15 -0400
commit2d3ddfd467036935bc983cd77b4ab1243ac58cb6 (patch)
treeed74e719e3d14857808a2dae5c5a08ebc35ed18d /model
parent46f86e7076a1dec6717a959299a08289a5cc54ac (diff)
parentad92a90b02fdcea3846376747cedf8c81e5a2d22 (diff)
downloadchat-2d3ddfd467036935bc983cd77b4ab1243ac58cb6.tar.gz
chat-2d3ddfd467036935bc983cd77b4ab1243ac58cb6.tar.bz2
chat-2d3ddfd467036935bc983cd77b4ab1243ac58cb6.zip
Merge release branch 'release-1.0.0'
Diffstat (limited to 'model')
-rw-r--r--model/user.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/model/user.go b/model/user.go
index 5cb774478..d8000a7e2 100644
--- a/model/user.go
+++ b/model/user.go
@@ -304,10 +304,14 @@ func isValidRole(role string) bool {
return false
}
+// Make sure you acually want to use this function. In context.go there are functions to check permssions
+// This function should not be used to check permissions.
func (u *User) IsInRole(inRole string) bool {
return IsInRole(u.Roles, inRole)
}
+// Make sure you acually want to use this function. In context.go there are functions to check permssions
+// This function should not be used to check permissions.
func IsInRole(userRoles string, inRole string) bool {
roles := strings.Split(userRoles, " ")