Skip to content

[1.x & 2.x] Global canStartDiscussion forum attribute returns true in unexpected cases #4276

@DavideIadeluca

Description

@DavideIadeluca

Current Behavior

When admins set the configured minimum number of primary and secondary tags to 0, the global forum attribute canStartDiscussion returns true even for suspended members

Steps to Reproduce

  1. Enable flarum/tags and flarum/suspend
  2. Set minimum required number of primary and secondary tags to 0
  3. Suspend a member
  4. Hit /api as that banned member, the global canStartDiscussionattribute will be true

Expected Behavior

The global canStartDiscussion attribute should return false for banned users

Screenshots

No response

Environment

n.a.

Output of php flarum info

Flarum core: 1.8.11
PHP version: 8.3.24
MySQL version: 8.0.43
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, calendar, exif, gd, intl, pcntl, pdo_mysql, sockets, sodium, zip, Zend OPcache
+----------------------+----------+--------+
| Flarum Extensions    |          |        |
+----------------------+----------+--------+
| ID                   | Version  | Commit |
+----------------------+----------+--------+
| flarum-flags         | 1.x-dev  |        |
| flarum-approval      | 1.x-dev  |        |
| flarum-tags          | 1.x-dev  |        |
| glowingblue-test     | dev-main |        |
| fof-nightmode        | 1.6.0    |        |
| fof-links            | 1.3.0    |        |
| flarum-suspend       | 1.x-dev  |        |
| flarum-subscriptions | 1.x-dev  |        |
| flarum-sticky        | 1.x-dev  |        |
| flarum-nicknames     | 1.x-dev  |        |
| flarum-mentions      | 1.x-dev  |        |
| flarum-markdown      | 1.x-dev  |        |
| flarum-lock          | 1.x-dev  |        |
| flarum-likes         | 1.x-dev  |        |
| flarum-lang-italian  | 1.17.0   |        |
| flarum-lang-german   | 1.20.0   |        |
| flarum-lang-french   | v4.29.0  |        |
| flarum-lang-english  | 1.x-dev  |        |
| flarum-lang-dutch    | v1.4.0   |        |
| blomstra-horizon     | 0.4.3    |        |
| blomstra-fontawesome | 0.1.5    |        |
+----------------------+----------+--------+
Base URL: http://flarum.localhost
Installation path: /var/www
Queue driver: redis
Session driver: redis (Code override. Configured to file)
Scheduler status: Attivo
Mail driver: log
Debug mode: ON

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions