Unable to approve threads with the approve post permission
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
**Current Behavior**
If a group has the permission to approve posts then they can approve any posts that are not the start of a thread.
In order to approve a thread a group also needs the edit post permission.
If a group has the approve post permission but not any edit permissions then they will still get flags about having to approve threads but when they click it they will get an error message: "The requested resource was not found."
**Steps to Reproduce**
1. Make a role "moderators" and give it permission to see flags and approve posts
2. Set all posts by new members to require approval
3. Create a new user and a moderator account
4. Create a thread with the new user and log into your moderator account
5. You will get a flag telling you to approve a thread but can't see the thread
**Expected Behavior**
People with the permission "approve posts" should be able to approve threads.
**Environment**
- Flarum version: 0.1.0-beta.15
- Webserver: apache2
- Hosting environment: VPS
- PHP version: 7.4.3
- Browser: Firefox 88.0.1
```
Flarum core 0.1.0-beta.15
PHP version: 7.4.3
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, intl, json, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlrpc, xmlwriter, xsl, zip, Z end OPcache
+-------------------------------+------------------+--------+
| Flarum Extensions | | |
+-------------------------------+------------------+--------+
| ID | Version | Commit |
+-------------------------------+------------------+--------+
| flarum-approval | v0.1.0-beta.15 | |
| flarum-bbcode | v0.1.0-beta.15 | |
| flarum-emoji | v0.1.0-beta.15 | |
| flarum-lang-english | v0.1.0-beta.15 | |
| flarum-flags | v0.1.0-beta.15 | |
| flarum-likes | v0.1.0-beta.15 | |
| flarum-lock | v0.1.0-beta.15 | |
| flarum-markdown | v0.1.0-beta.15 | |
| flarum-mentions | v0.1.0-beta.15 | |
| flarum-statistics | v0.1.0-beta.15 | |
| flarum-sticky | v0.1.0-beta.15.1 | |
| flarum-subscriptions | v0.1.0-beta.15 | |
| flarum-suspend | v0.1.0-beta.15 | |
| flarum-tags | v0.1.0-beta.15 | |
| fof-upload | 0.12.10 | |
| fof-formatting | 0.3.1 | |
| fof-user-bio | 0.4.2 | |
| fof-user-directory | 0.5.3 | |
| fof-transliterator | 0.3.0 | |
| askvortsov-moderator-warnings | v0.4.2 | |
| fof-impersonate | 0.7.0 | |
| fof-pages | 0.6.0 | |
+-------------------------------+------------------+--------+
Installation path: /var/www/flarum
Debug mode: off
```
Contributor guide
Research direction
Reproduce the permission setup described in the issue: allow flag viewing and post approval while withholding edit permissions, then create a thread requiring approval. Trace the approval flow until the “The requested resource was not found” response, and consider the work complete when users with only approve-post permission can access and approve the thread.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100