flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

Start a Discussion button appears when you don't have permission to do so #2509

Closed bram1000 closed 3 years ago

bram1000 commented 3 years ago

Bug Report

Current Behavior New users get a button "Start a discussion" on "All Discussions" even when they don't have permissions to post in any tag.

Steps to Reproduce Set your permissions so members can read posts but only certain roles can create posts. image

Go to All Discussions and you'll have the button to click "Start a Discussion" even when you don't have the permission to do so. image

You'll get the popup to create a forum discussion but you'll be unable to select a tag. image

Clicking on the "Choose Tags" button does nothing and I also get a lot of errors in the console. image

Expected Behavior When you click a tag it'll tell you that you can't start a discussion. image

The same behavior should apply to "All Discussions" when you don't have permissions in any of the tags to post anything and a minimum of 1 tag is required.

Environment

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, Zend 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 |        |
| 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.0         |        |
| fof-formatting                | 0.3.1          |        |
| fof-user-bio                  | 0.4.1          |        |
| fof-user-directory            | 0.5.0          |        |
| fof-transliterator            | 0.3.0          |        |
| askvortsov-moderator-warnings | v0.4.0         |        |
| fof-impersonate               | 0.7.0          |        |
+-------------------------------+----------------+--------+
Base URL: https://forum.nixpca.com
Installation path: /var/www/flarum
Debug mode: off

Additional Context The website uses a custom login method based off https://discuss.flarum.org/d/2808-how-i-implemented-cross-authentication-with-flarum so you won't be able to login or view the forum without an account on a different website.

bram1000 commented 3 years ago

image