Code comment

This commit is contained in:
Laurent Destailleur 2021-12-09 11:56:54 +01:00
parent d6ab7ab953
commit 7ea8b7851a

View File

@ -1075,12 +1075,14 @@ class User extends CommonObject
// First user permissions
$sql = "SELECT DISTINCT r.module, r.perms, r.subperms";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur";
$sql .= ", ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur,";
$sql .= " ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " WHERE r.id = ur.fk_id";
if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) {
// on old version, we use entity defined into table r
$sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").$conf->entity.")";
} else {
// we must now use entity into table ur
$sql .= " AND ur.entity = ".((int) $conf->entity);
}
$sql .= " AND ur.fk_user= ".((int) $this->id);