Skip to content

Commit 131159c

Browse files
committed
Fix some forgotten logic checks temporarily
1 parent 97d87ff commit 131159c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/Http/Requests/Admin/AdminFormRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function authorize()
4242
return false;
4343
}
4444

45-
return $this->user()->isRootAdmin();
45+
return (bool) $this->user()->root_admin;
4646
}
4747

4848
/**

app/Models/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function sendPasswordResetNotification($token)
202202
*/
203203
public function isRootAdmin()
204204
{
205-
return $this->root_admin === 1;
205+
return $this->root_admin;
206206
}
207207

208208
/**

app/Policies/APIKeyPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class APIKeyPolicy
4343
protected function checkPermission(User $user, Key $key, $permission)
4444
{
4545
// Non-administrative users cannot use administrative routes.
46-
if (! starts_with($key, 'user.') && ! $user->isRootAdmin()) {
46+
if (! starts_with($key, 'user.') && ! $user->root_admin) {
4747
return false;
4848
}
4949

app/Policies/ServerPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function checkPermission(User $user, Server $server, $permission)
6060
*/
6161
public function before(User $user, $ability, Server $server)
6262
{
63-
if ($user->isRootAdmin() || $server->owner_id === $user->id) {
63+
if ($user->root_admin || $server->owner_id === $user->id) {
6464
return true;
6565
}
6666

0 commit comments

Comments
 (0)