Fix some forgotten logic checks temporarily

This commit is contained in:
Dane Everitt 2017-09-10 23:57:18 -05:00
parent 97d87ff57c
commit 131159c246
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 4 additions and 4 deletions

View file

@ -42,7 +42,7 @@ abstract class AdminFormRequest extends FormRequest
return false;
}
return $this->user()->isRootAdmin();
return (bool) $this->user()->root_admin;
}
/**

View file

@ -202,7 +202,7 @@ class User extends Model implements
*/
public function isRootAdmin()
{
return $this->root_admin === 1;
return $this->root_admin;
}
/**

View file

@ -43,7 +43,7 @@ class APIKeyPolicy
protected function checkPermission(User $user, Key $key, $permission)
{
// Non-administrative users cannot use administrative routes.
if (! starts_with($key, 'user.') && ! $user->isRootAdmin()) {
if (! starts_with($key, 'user.') && ! $user->root_admin) {
return false;
}

View file

@ -60,7 +60,7 @@ class ServerPolicy
*/
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;
}