1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 22:20:21 +02:00

Only show reply button if user has permission

This commit is contained in:
Toby Zerner
2015-02-12 15:17:20 +10:30
parent d89bcef816
commit 875e239497
2 changed files with 13 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ var $ = Ember.$;
export default Ember.View.extend(HasItemLists, {
itemLists: ['sidebar'],
discussion: Ember.computed.alias('controller.model'),
didInsertElement: function() {
this.get('controller').on('loaded', this, this.loaded);
this.get('controller').on('startWasChanged', this, this.startWasChanged);
@@ -59,7 +61,8 @@ export default Ember.View.extend(HasItemLists, {
populateControls: function(items) {
var view = this;
this.addActionItem(items, 'reply', 'Reply').set('action', function() {
this.addActionItem(items, 'reply', 'Reply', 'reply', 'discussion.canReply', function() {
view.get('streamContent').send('goToLast');
view.get('controller').send('reply');
});