On SecurityGroups, when generating the SQL query to retrieve creator's groups, current user was always used.
Instead, now if "created_by" is filled, that user is used to generate the SQL query.
Motivation and Context
With creator inheritance set, when current user and created by differ, current user groups were used.
How To Test This
Same steps that needed to check the issue:
1. Create a new entrypoint which does not require login (and uses $current_user->getSystemUser();)
2. Create a user with some security groups
3. Assign some groups to system user (different from groups assigned to the previous user)
4. Create a new record on the new entrypoint on behalf of the previous user
5. Check that the new record has the user groups instead of system user's groups
Types of changes
[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Final checklist
[X] My code follows the code style of this project found here.
[ ] My change requires a change to the documentation.
Description
On SecurityGroups, when generating the SQL query to retrieve creator's groups, current user was always used. Instead, now if "created_by" is filled, that user is used to generate the SQL query.
Motivation and Context
With creator inheritance set, when current user and created by differ, current user groups were used.
How To Test This
Same steps that needed to check the issue:
Types of changes
Final checklist