For now, restrict whispering to staff only.
This commit is contained in:
parent
7e1a24e205
commit
91f3e8e724
|
@ -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() {
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue