Skip to content

Commit

Permalink
Fix #10545 - Current user groups are used instead of "created by" gro…
Browse files Browse the repository at this point in the history
…ups when they differ
  • Loading branch information
SinergiaCRM committed Oct 18, 2024
1 parent 80ee82d commit 51d4b78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/SecurityGroups/SecurityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ public static function inherit_creator($focus, $isUpdate)
} elseif ($focus->db->dbType == 'mssql') {
$query .= ' lower(newid()) ';
}
$currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null;
if (isset($focus->created_by) && $focus->created_by!= '') {
$currentUserId = $focus->db->quote($focus->created_by);
} else {
$currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null;
}
$recordId = $focus->db->quote($focus->id);
$query .= ",u.securitygroup_id,'$recordId','$focus->module_dir',"
. $focus->db->convert('', 'today') . ',0 '
Expand Down

0 comments on commit 51d4b78

Please sign in to comment.