mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 02:08:57 +00:00
Replace isAdmin, isDisabled and isModerator functions with direct role checking and remove roleCheck function from User model
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user