/** * Check if current user is allowed to use given widget * * @param String $widget * * @return Boolean */ protected function _userCanViewWidget($widget) { $um = UserManager::instance(); $user = $um->getCurrentUser(); if ($user) { $service = AdminDelegation_Service::getServiceFromWidget($widget); if ($service) { $usm = new AdminDelegation_UserServiceManager(); return $usm->isUserGrantedForService($user, $service); } } return false; }
/** * Widget content * * @see src/common/widget/Widget#getContent() * @return String */ public function getContent() { $html = ''; $usm = new AdminDelegation_UserServiceManager(); if ($usm->isUserGrantedForService(UserManager::instance()->getCurrentUser(), AdminDelegation_Service::SHOW_PROJECT_ADMINS)) { $html .= $this->_showProjectAdmins(); } return $html; }