mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-02 11:18:56 +00:00
Allow moderator role to edit releases, fixes issue #123
This commit is contained in:
@@ -11,11 +11,9 @@ use App\Http\Controllers\BasePageController;
|
||||
class ReleasesController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): void
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -107,10 +105,10 @@ class ReleasesController extends BasePageController
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
public function destroy($id): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
if ($id) {
|
||||
$releases = new Releases(['Settings' => null]);
|
||||
$releases = new Releases();
|
||||
$releases->deleteMultiple($id);
|
||||
}
|
||||
|
||||
|
||||
@@ -256,13 +256,14 @@ class BasePageController extends Controller
|
||||
if ($sab->integratedBool !== false && $sab->url !== '' && $sab->apikey !== '') {
|
||||
$this->smarty->assign('sabapikeytype', $sab->apikeytype);
|
||||
}
|
||||
switch ((int) $this->userdata['roles_id']) {
|
||||
case User::ROLE_ADMIN:
|
||||
$this->smarty->assign('isadmin', 'true');
|
||||
break;
|
||||
case User::ROLE_MODERATOR:
|
||||
$this->smarty->assign('ismod', 'true');
|
||||
if ($this->userdata->hasRole('Admin') === true) {
|
||||
$this->smarty->assign('isadmin', 'true');
|
||||
}
|
||||
|
||||
if ($this->userdata->hasRole('Moderator') === true) {
|
||||
$this->smarty->assign('ismod', 'true');
|
||||
}
|
||||
|
||||
// Tell Smarty which directories to use for templates
|
||||
$this->smarty->setTemplateDir([
|
||||
'user' => config('ytake-laravel-smarty.template_path').DIRECTORY_SEPARATOR.$this->theme,
|
||||
|
||||
Reference in New Issue
Block a user