Skip to content

Commit 45d8be8

Browse files
committed
Use User::can() method for perms
1 parent f159d15 commit 45d8be8

File tree

16 files changed

+19
-19
lines changed

16 files changed

+19
-19
lines changed

featherbb/Controller/Admin/Bans.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct()
2222
translate('admin/bans');
2323
translate('admin/common');
2424

25-
if (!Container::get('perms')->can(User::get(), 'mod.bans')) {
25+
if (!User::can('mod.bans')) {
2626
throw new Error(__('No permission'), '403');
2727
}
2828
}

featherbb/Controller/Admin/Categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct()
2121
{
2222
$this->model = new \FeatherBB\Model\Admin\Categories();
2323
translate('admin/categories');
24-
if (!Container::get('perms')->can(User::get(), 'board.categories')) {
24+
if (!User::can('board.categories')) {
2525
throw new Error(__('No permission'), '403');
2626
}
2727
}

featherbb/Controller/Admin/Censoring.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct()
1818
{
1919
$this->model = new \FeatherBB\Model\Admin\Censoring();
2020
translate('admin/censoring');
21-
if (!Container::get('perms')->can(User::get(), 'board.censoring')) {
21+
if (!User::can('board.censoring')) {
2222
throw new Error(__('No permission'), '403');
2323
}
2424
}

featherbb/Controller/Admin/Forums.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct()
2020
{
2121
$this->model = new \FeatherBB\Model\Admin\Forums();
2222
translate('admin/forums');
23-
if (!Container::get('perms')->can(User::get(), 'board.forums')) {
23+
if (!User::can('board.forums')) {
2424
throw new Error(__('No permission'), '403');
2525
}
2626
}

featherbb/Controller/Admin/Groups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct()
1919
{
2020
$this->model = new \FeatherBB\Model\Admin\Groups();
2121
translate('admin/groups');
22-
if (!Container::get('perms')->can(User::get(), 'board.groups')) {
22+
if (!User::can('board.groups')) {
2323
throw new Error(__('No permission'), '403');
2424
}
2525
}

featherbb/Controller/Admin/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Index
1919
public function __construct()
2020
{
2121
translate('admin/index');
22-
if (!Container::get('perms')->can(User::get(), 'mod.view')) {
22+
if (!User::can('mod.view')) {
2323
throw new Error(__('No permission'), '403');
2424
}
2525
}

featherbb/Controller/Admin/Maintenance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct()
1818
{
1919
$this->model = new \FeatherBB\Model\Admin\Maintenance();
2020
translate('admin/maintenance');
21-
if (!Container::get('perms')->can(User::get(), 'board.maintenance')) {
21+
if (!User::can('board.maintenance')) {
2222
throw new Error(__('No permission'), '403');
2323
}
2424
}

featherbb/Controller/Admin/Options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct()
1818
{
1919
$this->model = new \FeatherBB\Model\Admin\Options();
2020
translate('admin/options');
21-
if (!Container::get('perms')->can(User::get(), 'board.options')) {
21+
if (!User::can('board.options')) {
2222
throw new Error(__('No permission'), '403');
2323
}
2424
}

featherbb/Controller/Admin/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct()
2020
{
2121
$this->model = new \FeatherBB\Model\Admin\Parser();
2222
translate('admin/parser');
23-
if (!Container::get('perms')->can(User::get(), 'board.parser')) {
23+
if (!User::can('board.parser')) {
2424
throw new Error(__('No permission'), '403');
2525
}
2626
}

featherbb/Controller/Admin/Permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct()
1818
{
1919
$this->model = new \FeatherBB\Model\Admin\Permissions();
2020
translate('admin/permissions');
21-
if (!Container::get('perms')->can(User::get(), 'board.permissions')) {
21+
if (!User::can('board.permissions')) {
2222
throw new Error(__('No permission'), '403');
2323
}
2424
}

0 commit comments

Comments
 (0)