Added #2353: Add ability to tie locations to companies #10705
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Locations are the last big part of the application that can't be tied to companies.
This can be a problem with FullMultipleCompanySupport, because you can't restrict the visibility of locations to the company of the users.
The first commit wires everything up so that locations have a company_id and are properly scoped with FullMultipleCompanySupport.
The second commit preserve backward compatibility with the existing behaviour, as locations with company_id = null are shown regardless of the users company. I'm not sure if this is worth it and personally I don't need this for my organisation, but I included this just to show how it could be made possible.
The third commit introduces bulk operations for locations to ease transition for this new feature.
Fixes #2353
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
I developed and tested this feature with V5 and rebased it later to V6. All tests passed on this version either.
I checked that the correct locations are shown as SuperUser and scoped user with FullMultipleCompanySupport.
Checklist: