diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-30 11:30:11 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-30 14:26:37 -0400 |
commit | 7d31f3a271d933b8c276602d9fb77fd5d22055de (patch) | |
tree | b836506cc084e1907e39ca0d7283a4175a25ba50 /model | |
parent | 89b77cc72ffd9dec6242f66277a4aeffe6fb737b (diff) | |
download | chat-7d31f3a271d933b8c276602d9fb77fd5d22055de.tar.gz chat-7d31f3a271d933b8c276602d9fb77fd5d22055de.tar.bz2 chat-7d31f3a271d933b8c276602d9fb77fd5d22055de.zip |
Fixing some locations to use the IsTeamAdmin function which properly checks for system admin permissions.
Diffstat (limited to 'model')
-rw-r--r-- | model/user.go | 4 |
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, " ") |