Allow moderator role to edit releases, fixes issue #123

This commit is contained in:
DariusIII
2018-08-02 12:35:07 +02:00
parent d3494f33a4
commit db44d3a740
5 changed files with 147 additions and 145 deletions
+7 -6
View File
@@ -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,