1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-10-25 06:37:36 +03:00

Permissions: Updated usage of controller methods to use enum

This commit is contained in:
Dan Brown
2025-09-08 18:14:38 +01:00
parent 5fc11d46d5
commit 33a0237f87
43 changed files with 235 additions and 226 deletions

View File

@@ -5,6 +5,7 @@ namespace BookStack\Settings;
use BookStack\Activity\ActivityType;
use BookStack\App\AppVersion;
use BookStack\Http\Controller;
use BookStack\Permissions\Permission;
use BookStack\Users\Models\User;
use Illuminate\Http\Request;
@@ -24,7 +25,7 @@ class SettingController extends Controller
public function category(string $category)
{
$this->ensureCategoryExists($category);
$this->checkPermission('settings-manage');
$this->checkPermission(Permission::SettingsManage);
$this->setPageTitle(trans('settings.settings'));
return view('settings.categories.' . $category, [
@@ -41,7 +42,7 @@ class SettingController extends Controller
{
$this->ensureCategoryExists($category);
$this->preventAccessInDemoMode();
$this->checkPermission('settings-manage');
$this->checkPermission(Permission::SettingsManage);
$this->validate($request, [
'app_logo' => ['nullable', ...$this->getImageValidationRules()],
'app_icon' => ['nullable', ...$this->getImageValidationRules()],