/** * Function checks if user have basic permissions to launch the component * @return void */ protected function checkPermissions() { $result = true; if (!LocationHelper::checkLocationEnabled()) { $this->errors['FATAL'][] = 'Locations were disabled or data has not been converted'; $result = false; } return $result; }
/** * Function checks if user have basic permissions to launch the component * @throws Exception * @return void */ protected function checkPermissions() { $result = true; if ($GLOBALS['APPLICATION']->GetGroupRight("sale") < "W") { $this->errors['FATAL'][] = Loc::getMessage("SALE_SLI_SALE_MODULE_WRITE_ACCESS_DENIED"); $result = false; } if(!LocationHelper::checkLocationEnabled()) { $this->errors['FATAL'][] = 'Locations were disabled or data has not been converted'; $result = false; } return $result; }
protected static function checkAccessPermissions($parameters = array()) { if (!is_array($parameters)) { $parameters = array(); } $errors = array(); if ($GLOBALS['APPLICATION']->GetGroupRight("sale") < "W") { $errors[] = Loc::getMessage("SALE_SLI_SALE_MODULE_WRITE_ACCESS_DENIED"); } if (!LocationHelper::checkLocationEnabled()) { $errors[] = 'Locations were disabled or data has not been converted'; } if ($parameters['CHECK_CSRF']) { $post = \Bitrix\Main\Context::getCurrent()->getRequest()->getPostList(); if (!strlen($post['csrf']) || bitrix_sessid() != $post['csrf']) { $errors[] = 'CSRF token is not valid'; } } return $errors; }
protected static function checkAccessPermissions($parameters = array()) { if (!is_array($parameters)) { $parameters = array(); } $errors = array(); $CCrmPerms = new CCrmPerms($GLOBALS['USER']->GetID()); if ($CCrmPerms->HavePerm('CONFIG', BX_CRM_PERM_NONE, 'WRITE')) { $errors[] = Loc::getMessage("SALE_CCLI2_CRM_MODULE_WRITE_ACCESS_DENIED"); } if (!LocationHelper::checkLocationEnabled()) { $errors[] = 'Locations were disabled or data has not been converted'; } if ($parameters['CHECK_CSRF']) { $post = \Bitrix\Main\Context::getCurrent()->getRequest()->getPostList(); if (!strlen($post['csrf']) || bitrix_sessid() != $post['csrf']) { $errors[] = 'CSRF token is not valid'; } } return $errors; }