Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
fix (api/messages): perm update by admin (#53)
Browse files Browse the repository at this point in the history
* fix (api/messages): perm update by admin

Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>

* fix: topic.CanUpdateAllMsg

Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and bnjjj committed Aug 17, 2017
1 parent c18b979 commit 2a98d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func (m *MessagesController) addOrRemoveTask(ctx *gin.Context, messageIn *tat.Me
func (m *MessagesController) updateMessage(ctx *gin.Context, messageIn *tat.MessageJSON, message tat.Message, user tat.User, topic tat.Topic, isAdminOnTopic bool) {
var info string

if isAdminOnTopic && topic.CanUpdateAllMsg {
if isAdminOnTopic && (topic.AdminCanDeleteAllMsg || topic.CanUpdateAllMsg) {
// ok, user is admin on topic, and admin can update all msg
} else {
if !topic.CanUpdateMsg && !topic.CanUpdateAllMsg {
Expand Down

0 comments on commit 2a98d47

Please sign in to comment.