API Model updates.

This commit is contained in:
Dane Everitt
2017-02-10 17:29:10 -05:00
parent efef356870
commit 3b3002b77a
4 changed files with 56 additions and 10 deletions

View File

@@ -102,7 +102,7 @@ class APIRepository
{
$this->user = is_null($user) ? Auth::user() : $user;
if (is_null($this->user)) {
throw new \Exception('Cannot access API Repository without passing a user to __construct().');
throw new \Exception('Cannot access API Repository without passing a user to constructor.');
}
}
@@ -178,7 +178,7 @@ class APIRepository
}
}
if ($this->user->root_admin === 1 && isset($data['adminPermissions'])) {
if ($this->user->isRootAdmin() && isset($data['adminPermissions'])) {
foreach ($data['adminPermissions'] as $permNode) {
if (! strpos($permNode, ':')) {
continue;