Ejemplo n.º 1
0
 public function checkPermission(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $moduleModel = Reports_Module_Model::getInstance($moduleName);
     $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
         throw new NoPermittedException('LBL_PERMISSION_DENIED');
     }
 }
Ejemplo n.º 2
0
 public function checkPermission(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $moduleModel = Reports_Module_Model::getInstance($moduleName);
     $record = $request->get('record');
     $reportModel = Reports_Record_Model::getCleanInstance($record);
     $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId()) && !$reportModel->isEditable()) {
         throw new AppException('LBL_PERMISSION_DENIED');
     }
 }