-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A problem with tag permission for user. #3692
Comments
Confirmed. Breakdown of the issueRename discussion abilityThere is technically two abilities here, a rename own and rename any, but they are implicit. With no tag restrictions
With tag restrictions
That nullifies the passed own ability check. SolutionImo, we need a proper separation of own vs any permissions. But that might require a big refactor. |
Thanks for the confirmation, I'm looking forward to the refactored permissions system |
Although there is a problem with the underlying permission design of the Flarum framework, this is actually a problem introduced by the official plug-in Tag. Can the Tag plug-in be patched to temporarily solve this problem? For example, the following code can allow users to modify the title of their posts (only unlimited, for reference only, please do not copy, Unless you clearly understand the meaning of this code) if ($actor->id == $discussion->user_id && isset($this->special_ability[$ability])) {
$setting_value = $this->settings->get($this->special_ability[$ability]);
switch ($setting_value) {
case 'reply':
// Check if it is replied
break;
case '-1':
return $this->allow();
break;
default:
if (!is_numeric($setting_value) || !$setting_value > 0) {
break;
}
// Check creation time
}
} |
Current Behavior
I get a problem with some permission about tag.
When I set permission by tag,although the global permission is set for Indefinitely,but tag permission is null,and I can't edit this permission.User also can't get this permission.like rename post himself,delete post himself on this tag.
Steps to Reproduce
1.Create a Tag
2.Create a permission rule by this tag,set global permission
Allow renaming
toIndefinitely
3.Login with a default users,and create a post with this tag.
4.Now,the user can't edit himself post title,and he can't delete this post.
Expected Behavior
I think all tag permission maybe can edit,If tag permissions not set ,The tag permissions must inherit global permissions.
This rule is also same in
Restrict by Tag
.When admin set the tag permission,the permissions of 'null' must inherit global permissions.Screenshots
No response
Environment
Output of
php flarum info
Flarum core 1.6.2
PHP version: 8.1.7
MySQL version: 8.0.24
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, mbstring, SPL, session, pcntl, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvsem, tokenizer, xml, xmlreader, xmlwriter, zip, fileinfo, redis, exif, imagick, gmp, memcached, Zend OPcache
+-------------------------------------+--------------+--------+
| Flarum Extensions | | |
+-------------------------------------+--------------+--------+
| ID | Version | Commit |
+-------------------------------------+--------------+--------+
| flarum-flags | v1.6.1 | |
| flarum-approval | v1.6.1 | |
| flarum-tags | v1.6.1 | |
| flarum-suspend | v1.6.1 | |
| askvortsov-auto-moderator | dev-master | |
| flarum-sticky | v1.6.0 | |
| flarum-nicknames | v1.6.0 | |
| flarum-lock | v1.6.0 | |
| fof-byobu | 1.1.7 | |
| flarum-markdown | v1.6.1 | |
| afrux-forum-widgets-core | v0.1.7 | |
| zerosonesfun-direct-links | 3.1 | |
| v17development-user-badges | v1.1.0 | |
| v17development-seo | v1.8.0 | |
| the-turk-stickiest | 3.0.1 | |
| the-turk-flamoji | 1.0.4 | |
| sycho-profile-cover | v1.3.3 | |
| swaggymacro-only-starter | 0.6.4 | |
| pipecraft-id-slug | v1.1.0 | |
| michaelbelgium-discussion-views | v7.1.3 | |
| kilowhat-audit-free | 1.5.1 | |
| fof-user-directory | 1.2.3 | |
| fof-user-bio | 1.1.0 | |
| fof-upload | 1.3.0-beta.1 | |
| fof-terms | 1.2.0 | |
| fof-sitemap | 2.0.1 | |
| fof-recaptcha | 1.1.0 | |
| fof-pretty-mail | 1.1.1 | |
| fof-polls | 1.3.0 | |
| fof-nightmode | 1.5.1 | |
| fof-linguist | 1.0.4 | |
| fof-drafts | 1.1.2 | |
| fof-doorman | 1.1.1 | |
| fof-default-user-preferences | 1.1.1 | |
| fof-best-answer | 1.2.4 | |
| fof-analytics | 1.1.0 | |
| flarum-subscriptions | v1.6.0 | |
| flarum-statistics | v1.6.1 | |
| flarum-mentions | v1.6.1 | |
| flarum-likes | v1.6.1 | |
| flarum-lang-english | v1.6.0 | |
| flarum-lang-chinese-simplified | dev-master | |
| flarum-bbcode | v1.6.0 | |
| darkle-fancybox | 1.1.2 | |
| clarkwinkelmann-see-past-first-post | 1.3.0 | |
| blomstra-database-queue | 0.1-beta.2 | |
| askvortsov-rich-text | v2.1.7 | |
| askvortsov-pwa | v3.1.3 | |
| afrux-online-users-widget | v0.1.6 | |
| afrux-news-widget | v0.1.1 | |
+-------------------------------------+--------------+--------+
Base URL:
Installation path:
Queue driver: redis
Session driver: redis (Code override. Configured to file)
Mail driver: smtp
Debug mode: off
Possible Solution
No response
Additional Context
This problem is old,You can find same problem in flarum discussion.
The text was updated successfully, but these errors were encountered: