Skip to content

Commit 51d4b78

Browse files
committed
Fix #10545 - Current user groups are used instead of "created by" groups when they differ
1 parent 80ee82d commit 51d4b78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/SecurityGroups/SecurityGroup.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,11 @@ public static function inherit_creator($focus, $isUpdate)
281281
} elseif ($focus->db->dbType == 'mssql') {
282282
$query .= ' lower(newid()) ';
283283
}
284-
$currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null;
284+
if (isset($focus->created_by) && $focus->created_by!= '') {
285+
$currentUserId = $focus->db->quote($focus->created_by);
286+
} else {
287+
$currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null;
288+
}
285289
$recordId = $focus->db->quote($focus->id);
286290
$query .= ",u.securitygroup_id,'$recordId','$focus->module_dir',"
287291
. $focus->db->convert('', 'today') . ',0 '

0 commit comments

Comments
 (0)