1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 03:01:22 +02:00

Fuzzy-match global forum permissions

This means that the "Start a Discussion" button will still be enabled if the user is not allowed to start globally, but only in certain tags.

Also add some other stuff to the changelog.

closes #640
This commit is contained in:
Toby Zerner
2015-12-03 15:04:55 +10:30
parent d4e52a6ad8
commit 127b4a7607
2 changed files with 16 additions and 2 deletions

View File

@@ -75,8 +75,8 @@ class ForumSerializer extends AbstractSerializer
'themePrimaryColor' => $this->settings->get('theme_primary_color'),
'allowSignUp' => (bool) $this->settings->get('allow_sign_up'),
'defaultRoute' => $this->settings->get('default_route'),
'canViewDiscussions' => $gate->allows('viewDiscussions'),
'canStartDiscussion' => $gate->allows('startDiscussion')
'canViewDiscussions' => $gate->allows('viewDiscussions') || $this->actor->hasPermissionLike('viewDiscussions'),
'canStartDiscussion' => $gate->allows('startDiscussion') || $this->actor->hasPermissionLike('startDiscussion')
];
if ($gate->allows('administrate')) {