summaryrefslogtreecommitdiffstats
path: root/api4/reaction.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-02-19 12:13:29 +0100
committerGeorge Goldberg <george@gberg.me>2018-02-19 11:13:29 +0000
commit8891fa2a5e9e08eb9fa99ec163c47a6e9761a816 (patch)
tree1cb5b375cbedf397d71ad8df3d009e4b5efb1357 /api4/reaction.go
parent0e718a632a616bcfec4378f512182245b68f4fd8 (diff)
downloadchat-8891fa2a5e9e08eb9fa99ec163c47a6e9761a816.tar.gz
chat-8891fa2a5e9e08eb9fa99ec163c47a6e9761a816.tar.bz2
chat-8891fa2a5e9e08eb9fa99ec163c47a6e9761a816.zip
MM-8827: Add ADD_REACTION, REMOVE_REACTION and REMOVE_OTHERS_REACTIONS permissions (#8300)
Diffstat (limited to 'api4/reaction.go')
-rw-r--r--api4/reaction.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/api4/reaction.go b/api4/reaction.go
index af637bf91..337b49751 100644
--- a/api4/reaction.go
+++ b/api4/reaction.go
@@ -32,8 +32,8 @@ func saveReaction(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if !c.App.SessionHasPermissionToChannelByPost(c.Session, reaction.PostId, model.PERMISSION_READ_CHANNEL) {
- c.SetPermissionError(model.PERMISSION_READ_CHANNEL)
+ if !c.App.SessionHasPermissionToChannelByPost(c.Session, reaction.PostId, model.PERMISSION_ADD_REACTION) {
+ c.SetPermissionError(model.PERMISSION_ADD_REACTION)
return
}
@@ -82,13 +82,13 @@ func deleteReaction(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if !c.App.SessionHasPermissionToChannelByPost(c.Session, c.Params.PostId, model.PERMISSION_READ_CHANNEL) {
- c.SetPermissionError(model.PERMISSION_READ_CHANNEL)
+ if !c.App.SessionHasPermissionToChannelByPost(c.Session, c.Params.PostId, model.PERMISSION_REMOVE_REACTION) {
+ c.SetPermissionError(model.PERMISSION_REMOVE_REACTION)
return
}
- if c.Params.UserId != c.Session.UserId && !c.App.SessionHasPermissionTo(c.Session, model.PERMISSION_MANAGE_SYSTEM) {
- c.SetPermissionError(model.PERMISSION_MANAGE_SYSTEM)
+ if c.Params.UserId != c.Session.UserId && !c.App.SessionHasPermissionTo(c.Session, model.PERMISSION_REMOVE_OTHERS_REACTIONS) {
+ c.SetPermissionError(model.PERMISSION_REMOVE_OTHERS_REACTIONS)
return
}