Merge pull request #21999 from dolibit-ut/patch-494

Update compare.php
This commit is contained in:
Laurent Destailleur 2022-08-31 14:50:54 +02:00 committed by GitHub
commit 19b436b09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* \file class/compare.php * \file htdocs/hrm/compare.php
* \ingroup hrm * \ingroup hrm
* \brief This file compares skills of user groups * \brief This file compares skills of user groups
* *
@ -33,23 +33,29 @@
* *
*/ */
// Load Dolibarr environment
require_once '../main.inc.php'; require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm.lib.php';
$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read;
$permissiontoadd = 0;
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
// Load translation files required by the page
$langs->load('hrm'); $langs->load('hrm');
// Permissions
$permissiontoread = $user->rights->hrm->evaluation->read || $user->rights->hrm->compare_advance->read;
$permissiontoadd = 0;
if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden();
/* /*
* View * View