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

**URL:** https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495
**Category:** Bug
**Created:** [December 20, 2017, 5:17pm UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495 "2017-12-20T17:17:14Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [December 20, 2017, 5:17pm UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/1 "2017-12-20T17:17:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [December 20, 2017, 10:55pm UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/2 "2017-12-20T22:55:42Z")

</div>

This was reported a week ago by @SidV in [Composer appears when the topic is closed](https://meta.discourse.org/t/composer-appears-when-the-topic-is-closed/75886), which was specific to closed topics. Closed the other topic as this report is broader.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 20, 2017, 11:33pm UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/3 "2017-12-20T23:33:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 20, 2017, 11:58pm UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/4 "2017-12-20T23:58:10Z")

</div>

Cause it does this:

```plaintext
 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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [December 21, 2017, 12:09am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/5 "2017-12-21T00:09:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 21, 2017, 12:24am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/7 "2017-12-21T00:24:44Z")

</div>

Fixed per:

[https://github.com/discourse/discourse/commit/e756d020881b3a60122bd76ac740e5aaae028c21](https://github.com/discourse/discourse/commit/e756d020881b3a60122bd76ac740e5aaae028c21)

---

<div class="post-metadata">

### Author: ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)
#### Post date: [December 21, 2017, 2:01am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/8 "2017-12-21T02:01:33Z")

</div>

> [@sam](#):
>
> Fixed (…)

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 21, 2017, 2:02am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/9 "2017-12-21T02:02:44Z")

</div>

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

Will fix as well…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 21, 2017, 2:09am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/10 "2017-12-21T02:09:54Z")

</div>

Fixed per:

[https://github.com/discourse/discourse/commit/252cbd8635ab6b5dd66be856ba4a2c1f8f862dd1](https://github.com/discourse/discourse/commit/252cbd8635ab6b5dd66be856ba4a2c1f8f862dd1)

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [December 21, 2017, 2:32am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/11 "2017-12-21T02:32:28Z")

</div>

> [@sam](#):
>
> hmmm not sure it was right to merge the two.

That’s my bad, sorry @sam.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 21, 2017, 2:52am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/12 "2017-12-21T02:52:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 22, 2017, 7:00am UTC](https://meta.discourse.org/t/composer-shortcut-should-be-disabled-if-user-isnt-allowed-to-post/76495/13 "2017-12-22T07:00:02Z")

</div>

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