# "Delete Spammer" from "Flag" menu returns 403, doesn't work

**URL:** https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975
**Category:** Bug
**Created:** [13.Ноябрь.2017 10:39:45 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975 "2017-11-13T10:39:45Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Sujan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sujan/32/70979_2.png) [@Sujan](https://meta.discourse.org/u/Sujan)
#### Post date: [13.Ноябрь.2017 10:39:46 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/1 "2017-11-13T10:39:46Z")

</div>

Happening on hosted discourse [https://forum.ionicframework.com/](https://forum.ionicframework.com/) all the time:

- I see a spam post of a new user.
- Click “…” and then “Flag” icon
- Mark “It’s spam”
- Click “Delete spammer” button
- Get 403 response from backend for `email.json`:

![image](https://global.discourse-cdn.com/meta/original/3X/a/7/a7c4fc5561d64f3718a131c8b36ebb5c9e4046cd.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/d/5d60150900e5129e745de99fba2a05d0264b9702.png)

![image](https://global.discourse-cdn.com/meta/original/3X/0/e/0e938399d538484ad5fdf2ee99fc579a6486b72a.png)

---

<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: [13.Ноябрь.2017 11:11:25 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/2 "2017-11-13T11:11:25Z")

</div>

Can we repro this @eviltrout?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [13.Ноябрь.2017 17:18:33 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/3 "2017-11-13T17:18:33Z")

</div>

I could not reproduce this one. @Sujan can you provide any more details? For example are you a moderator or an admin when you do this?

---

<div class="post-metadata">

### Author: ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)
#### Post date: [13.Ноябрь.2017 17:35:34 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/4 "2017-11-13T17:35:34Z")

</div>

I reported the same issue here:

[https://meta.discourse.org/t/delete-spammer-on-admin-flags-doesnt-work-for-mods-if-show-email-on-profile-setting-is-turned-off/66785?u=osama](https://meta.discourse.org/t/delete-spammer-on-admin-flags-doesnt-work-for-mods-if-show-email-on-profile-setting-is-turned-off/66785)

In short, this is only an issue for moderators when the `show_email_on_profile` site setting is turned off which is the default.

---

<div class="post-metadata">

### Author: ![Sujan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sujan/32/70979_2.png) [@Sujan](https://meta.discourse.org/u/Sujan)
#### Post date: [13.Ноябрь.2017 17:55:19 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/5 "2017-11-13T17:55:19Z")

</div>

Yes, I am a moderator.  
[https://meta.discourse.org/t/delete-spammer-on-admin-flags-doesnt-work-for-mods-if-show-email-on-profile-setting-is-turned-off/66785?u=osama&source\_topic\_id=73975](https://meta.discourse.org/t/delete-spammer-on-admin-flags-doesnt-work-for-mods-if-show-email-on-profile-setting-is-turned-off/66785?source_topic_id=73975) does look relevant.

---

<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: [13.Ноябрь.2017 19:59:22 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/6 "2017-11-13T19:59:22Z")

</div>

> [@Osama](#):
>
> this is only an issue for moderators when the show\_email\_on\_profile site setting is turned off which is the default.

Aha does that help narrow it down @eviltrout?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [14.Ноябрь.2017 22:15:29 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/7 "2017-11-14T22:15:29Z")

</div>

I just tried this as a moderator and clicked delete spammer from the modal and it worked fine. Also @Osama in that topic @zogstrip says he fixed it back in July? Is it not fixed?

---

<div class="post-metadata">

### Author: ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)
#### Post date: [15.Ноябрь.2017 04:53:56 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/8 "2017-11-15T04:53:56Z")

</div>

Hi Robin

@zogstrip’s commit fixed a related issue, but doesn’t seem to have fixed this very particular issue because I’m able to reproduce it everytime I attempt on my dev install (it’s on absolute latest).

> [@eviltrout](#):
>
> I just tried this as a moderator and clicked delete spammer from the modal and it worked fine.

Did the account has admin rights as well as moderator rights? If so then the admin rights need to be revoked to be able reproduce this bug. And was the `show_email_on_profile` setting **disabled**? If these two conditions are met, you should be able to reproduce this.

I’m sure this has something to do with permissions to view emails. See `X-Discourse-Route` in response headers:

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/f/3f3747f7bc8dec01fbd1de04cfe058f65f4278df.png)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [15.Ноябрь.2017 15:47:03 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/10 "2017-11-15T15:47:03Z")

</div>

I am not sure why I wasn’t able to reproduce it before but I managed to do it this morning (3rd time is the charm?).

Here’s a fix:

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

---

<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: [17.Ноябрь.2017 02:00:10 UTC](https://meta.discourse.org/t/delete-spammer-from-flag-menu-returns-403-doesnt-work/73975/11 "2017-11-17T02:00:10Z")

</div>

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