Composer shortcut should be disabled if user isn't allowed to post


#1

In cases where a member isn’t allowed to post, the composer should not open under any circumstances.

Currently if TL settings are set so that TL0 isn’t allowed to post, hitting C opens the composer window.


Composer appears when the topic is closed
Composer appears when the topic is closed
(Joshua Rosenfeld) #2

This was reported a week ago by @SidV in Composer appears when the topic is closed, which was specific to closed topics. Closed the other topic as this report is broader.


(Jeff Atwood) #3

We should fix this @sam. Why is it avoiding the normal code paths here? This smells bad.


(Sam Saffron) #4

Cause it does this:

 createTopic() {
    this.container.lookup('controller:composer').open({action: Composer.CREATE_TOPIC, draftKey: Composer.CREATE_TOPIC});
  },

The permission itself is attached to the topic list serializer and category topic list serializer cause “can create topic” actually means “can create topic in current category” when you are drilled into a category. This info is not available when you are looking at a topic.

Current user serializer does not have a general “can create topics” on the forum. We would have to add it there.


(Jeff Atwood) #5

Ok so this would need to be a 2.0 fix? Can the composer itself do a check and disable itself if it does not end up having permissions? Since composer is doing http calls anyways


(Sam Saffron) #7

Fixed per:


#8

Sam, that fixes only for creating topic, isn’t it?
Because on closed topics, if I press SHIFT + R, the composer appears.


(Sam Saffron) #9

That is a different bug though… hmmm not sure it was right to merge the two.

Will fix as well…


(Sam Saffron) #10

Fixed per:


(Joshua Rosenfeld) #11

That’s my bad, sorry @sam.


(Sam Saffron) #12

For the best anyway cause now we have 2 less bugs instead of just 1


(Sam Saffron) #13

This topic was automatically closed after 30 hours. New replies are no longer allowed.