1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Extracted some methods into a BookRepo

This commit is contained in:
Dan Brown
2019-09-15 23:28:23 +01:00
parent d28abf24d4
commit 60d0f96cd7
14 changed files with 233 additions and 173 deletions

View File

@ -137,7 +137,7 @@ class PermissionsRepo
// Prevent deleting admin role or default registration role.
if ($role->system_name && in_array($role->system_name, $this->systemRoles)) {
throw new PermissionsException(trans('errors.role_system_cannot_be_deleted'));
} else if ($role->id == setting('registration-role')) {
} else if ($role->id === intval(setting('registration-role'))) {
throw new PermissionsException(trans('errors.role_registration_default_cannot_delete'));
}