From ba97ad561ef9b7d9cda9f57aeb91743b0da50279 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 14 Oct 2015 16:11:00 +1030 Subject: [PATCH] Remove `forum.` prefix from permissions closes #425 --- framework/core/js/admin/src/components/PermissionGrid.js | 6 +++--- framework/core/src/Api/Serializer/ForumSerializer.php | 1 - framework/core/src/Install/Console/InstallCommand.php | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/framework/core/js/admin/src/components/PermissionGrid.js b/framework/core/js/admin/src/components/PermissionGrid.js index df5a96c5f..b3849eec9 100644 --- a/framework/core/js/admin/src/components/PermissionGrid.js +++ b/framework/core/js/admin/src/components/PermissionGrid.js @@ -84,10 +84,10 @@ export default class PermissionGrid extends Component { viewItems() { const items = new ItemList(); - items.add('view', { + items.add('viewDiscussions', { icon: 'eye', label: app.trans('core.admin.permissions_view_discussions_label'), - permission: 'forum.view', + permission: 'viewDiscussions', allowGuest: true }, 100); @@ -112,7 +112,7 @@ export default class PermissionGrid extends Component { items.add('start', { icon: 'edit', label: app.trans('core.admin.permissions_start_discussions_label'), - permission: 'forum.startDiscussion' + permission: 'startDiscussion' }, 100); items.add('allowRenaming', { diff --git a/framework/core/src/Api/Serializer/ForumSerializer.php b/framework/core/src/Api/Serializer/ForumSerializer.php index 7abc98877..82b0414aa 100644 --- a/framework/core/src/Api/Serializer/ForumSerializer.php +++ b/framework/core/src/Api/Serializer/ForumSerializer.php @@ -76,7 +76,6 @@ class ForumSerializer extends AbstractSerializer 'allowSignUp' => (bool) $this->settings->get('allow_sign_up'), 'defaultRoute' => $this->settings->get('default_route'), 'canViewDiscussions' => $gate->allows('viewDiscussions'), - 'canViewUserList' => $gate->allows('viewUserList'), 'canStartDiscussion' => $gate->allows('startDiscussion') ]; diff --git a/framework/core/src/Install/Console/InstallCommand.php b/framework/core/src/Install/Console/InstallCommand.php index 3e7138dfc..6b75516a9 100644 --- a/framework/core/src/Install/Console/InstallCommand.php +++ b/framework/core/src/Install/Console/InstallCommand.php @@ -274,10 +274,10 @@ class InstallCommand extends AbstractCommand { $permissions = [ // Guests can view the forum - [2, 'forum.view'], + [2, 'viewDiscussions'], // Members can create and reply to discussions - [3, 'forum.startDiscussion'], + [3, 'startDiscussion'], [3, 'discussion.reply'], // Moderators can edit + delete stuff