Fix some forgotten logic checks temporarily
This commit is contained in:
parent
97d87ff57c
commit
131159c246
|
@ -42,7 +42,7 @@ abstract class AdminFormRequest extends FormRequest
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->user()->isRootAdmin();
|
return (bool) $this->user()->root_admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -202,7 +202,7 @@ class User extends Model implements
|
||||||
*/
|
*/
|
||||||
public function isRootAdmin()
|
public function isRootAdmin()
|
||||||
{
|
{
|
||||||
return $this->root_admin === 1;
|
return $this->root_admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ class APIKeyPolicy
|
||||||
protected function checkPermission(User $user, Key $key, $permission)
|
protected function checkPermission(User $user, Key $key, $permission)
|
||||||
{
|
{
|
||||||
// Non-administrative users cannot use administrative routes.
|
// Non-administrative users cannot use administrative routes.
|
||||||
if (! starts_with($key, 'user.') && ! $user->isRootAdmin()) {
|
if (! starts_with($key, 'user.') && ! $user->root_admin) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class ServerPolicy
|
||||||
*/
|
*/
|
||||||
public function before(User $user, $ability, Server $server)
|
public function before(User $user, $ability, Server $server)
|
||||||
{
|
{
|
||||||
if ($user->isRootAdmin() || $server->owner_id === $user->id) {
|
if ($user->root_admin || $server->owner_id === $user->id) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue