Replace isAdmin, isDisabled and isModerator functions with direct role checking and remove roleCheck function from User model

This commit is contained in:
DariusIII
2018-08-03 11:10:01 +02:00
parent ebfa8210cb
commit dd977c65b7
6 changed files with 9 additions and 52 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ class GetNzbController extends BasePageController
$uid = Auth::id();
$maxDownloads = $this->userdata->role->downloadrequests;
$rssToken = $this->userdata['api_token'];
if (User::isDisabled($this->userdata['id'])) {
if ($this->userdata->hasRole('Disabled') === true) {
Utility::showApiError(101);
}
} else {
@@ -47,7 +47,7 @@ class GetNzbController extends BasePageController
$uid = $res['id'];
$rssToken = $res['api_token'];
$maxDownloads = $res->role->downloadrequests;
if (User::isDisabled($res['id'])) {
if ($res->hasRole('Disabled') === true) {
Utility::showApiError(101);
}
}