summaryrefslogtreecommitdiffstats
path: root/api4/reaction.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-03-27 22:36:55 +0100
committerGeorge Goldberg <george@gberg.me>2018-03-27 22:36:55 +0100
commit71c9dff7662868770f66ab876ad66b354133c2c1 (patch)
treee2d5d8c5ad203b42af868ee18399c42a9ab08385 /api4/reaction.go
parent2af4c7e6496d4c5192fedf5001817f6f1eb3664b (diff)
parente13e64711f7a7e8ceadb8cbc6af72c4022c95b36 (diff)
downloadchat-71c9dff7662868770f66ab876ad66b354133c2c1.tar.gz
chat-71c9dff7662868770f66ab876ad66b354133c2c1.tar.bz2
chat-71c9dff7662868770f66ab876ad66b354133c2c1.zip
Merge branch 'advanced-permissions-phase-1'
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
}