/**
  * @param string $uniqueLayoutId
  * @param array $metadata
  * @return array
  */
 protected function getPortlets($uniqueLayoutId, $metadata)
 {
     assert('is_string($uniqueLayoutId)');
     assert('is_array($metadata)');
     $portlets = parent::getPortlets($uniqueLayoutId, $metadata);
     return PortletsSecurityUtil::resolvePortletsForCurrentUser($portlets);
 }
Esempio n. 2
0
 /**
  * Render a toolbar above the form layout. This includes
  * a link to edit the dashboard as well as a link to add
  * portlets to the dashboard
  * @return A string containing the element's content.
  */
 protected function renderActionElementBar($renderedInForm)
 {
     $content = parent::renderActionElementBar($renderedInForm);
     $deleteDashboardLinkActionElement = new DeleteDashboardLinkActionElement($this->controllerId, $this->moduleId, $this->modelId, array('htmlOptions' => array('class' => 'icon-delete', 'confirm' => Zurmo::t('HomeModule', 'Are you sure want to delete this dashboard?'))));
     if (!ActionSecurityUtil::canCurrentUserPerformAction($deleteDashboardLinkActionElement->getActionType(), $this->model)) {
         return $content;
     }
     if (!$this->isDefaultDashboard) {
         $content .= $deleteDashboardLinkActionElement->render();
     }
     $content .= $this->renderChangeDashboardLinkActionContent();
     return $content;
 }