Skip to content

Commit

Permalink
dev: added some permission to the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Jul 30, 2013
1 parent ec35d5a commit af8fbeb
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions application/extensions/Menu/MenuWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ protected function menuMain()
'alt' => gT('Manage survey administrators'),
'image' => 'security.png',
);
$menu['items']['left'][] = array(
'href' => array('admin/usergroups/sa/index'),
'alt' => gT('Create/edit user groups'),
'image' => 'usergroup.png'
);

$menu['items']['left'][] = $this->userGroups();
$menu['items']['left'][] = $this->globalSettings();
$menu['items']['left'][] = 'separator';
$menu['items']['left'][] = $this->checkIntegrity();
Expand All @@ -75,11 +71,7 @@ protected function menuMain()
$menu['items']['left'][] = $this->editTemplates();
$menu['items']['left'][] = 'separator';
$menu['items']['left'][] = $this->participantDatabase();
$menu['items']['left'][] = array(
'href' => array('/plugins'),
'alt' => gT('Plugin manager'),
'image' => 'plugin.png'
);
$menu['items']['left'][] = $this->pluginManager();

$surveys = getSurveyList(true);
$surveyList = array();
Expand Down Expand Up @@ -582,6 +574,18 @@ protected function editTemplates()
);
}
}

protected function userGroups()
{
if(Permission::model()->hasGlobalPermission('usergroups','read'))
{
return array(
'href' => array('admin/usergroups/sa/index'),
'alt' => gT('Create/edit user groups'),
'image' => 'usergroup.png'
);
}
}

protected function participantDatabase()
{
Expand All @@ -594,6 +598,18 @@ protected function participantDatabase()
);
}
}

protected function pluginManager()
{
if (Permission::model()->hasGlobalPermission('superadmin','read'))
{
return array(
'href' => array('/plugins'),
'alt' => gT('Plugin manager'),
'image' => 'plugin.png'
);
}
}

}

Expand Down

0 comments on commit af8fbeb

Please sign in to comment.