For now, restrict whispering to staff only.

This commit is contained in:
Robin Ward 2015-09-15 12:29:15 -04:00
parent 7e1a24e205
commit 91f3e8e724
2 changed files with 3 additions and 2 deletions

View File

@ -67,7 +67,8 @@ export default Ember.Controller.extend({
@computed('model.action') @computed('model.action')
canWhisper(action) { canWhisper(action) {
return this.siteSettings.enable_whispers && action === Composer.REPLY; const currentUser = this.currentUser;
return currentUser && currentUser.get('staff') && this.siteSettings.enable_whispers && action === Composer.REPLY;
}, },
showWarning: function() { showWarning: function() {

View File

@ -465,7 +465,7 @@ class PostsController < ApplicationController
result[:is_warning] = false result[:is_warning] = false
end end
if SiteSetting.enable_whispers? && params[:whisper] == "true" if current_user.staff? && SiteSetting.enable_whispers? && params[:whisper] == "true"
result[:post_type] = Post.types[:whisper] result[:post_type] = Post.types[:whisper]
end end