mirror of https://github.com/MISP/MISP
chg: [analyst-data:ACL] Added ACL rules and fixed side-menu to support ACL
parent
e3b09cd5a5
commit
5664a735e2
|
@ -60,7 +60,7 @@ class AnalystDataController extends AppController
|
|||
if ($type == 'Relationship') {
|
||||
$this->set('existingRelations', $this->AnalystData->getExistingRelationships());
|
||||
}
|
||||
$this->set('menuData', array('menuList' => 'analyst_data', 'menuItem' => 'add'));
|
||||
$this->set('menuData', array('menuList' => 'analyst_data', 'menuItem' => 'add_' . strtolower($type)));
|
||||
$this->render('add');
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,14 @@ class ACLComponent extends Component
|
|||
'queryACL' => array(),
|
||||
'restSearch' => array('*'),
|
||||
),
|
||||
'analystData' => [
|
||||
'add' => ['perm_add'],
|
||||
'delete' => ['perm_add'],
|
||||
'edit' => ['perm_add'],
|
||||
'getRelatedElement' => ['*'],
|
||||
'index' => ['*'],
|
||||
'view' => ['*'],
|
||||
],
|
||||
'api' => [
|
||||
'rest' => ['perm_auth'],
|
||||
'viewDeprecatedFunctionUse' => [],
|
||||
|
|
|
@ -1808,6 +1808,24 @@ $divider = '<li class="divider"></li>';
|
|||
'url' => '/analystData/index',
|
||||
'text' => __('List Analyst Data')
|
||||
));
|
||||
if ($this->Acl->canAccess('analyst_notes', 'add')) {
|
||||
echo $divider;
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'add_note',
|
||||
'url' => sprintf('/analystData/add/Note'),
|
||||
'text' => __('Add Analyst Note')
|
||||
));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'add_opinion',
|
||||
'url' => sprintf('/analystData/add/Opinion'),
|
||||
'text' => __('Add Analyst Opinion')
|
||||
));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'add_relationship',
|
||||
'url' => sprintf('/analystData/add/Relationship'),
|
||||
'text' => __('Add Analyst Relationship')
|
||||
));
|
||||
}
|
||||
if ($menuItem === 'view' || $menuItem === 'edit') {
|
||||
echo $divider;
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
|
|
Loading…
Reference in New Issue