diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 1aefe57ea63..02083e2d57a 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -159,6 +159,9 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { if (post.get('post_number') === 1) { this.deleteTopic(); return; + } else if (!post.can_delete) { + // check if current user can delete post + return false; } const user = Discourse.User.current(), @@ -200,6 +203,11 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { return bootbox.alert(I18n.t('post.controls.edit_anonymous')); } + // check if current user can edit post + if (!post.can_edit) { + return false; + } + const composer = this.get('controllers.composer'), composerModel = composer.get('model'), opts = {