Fix group IP allowlist update bug
What does this MR do and why?
Related to #364630 (closed)
The bug is further described here:
Currently, users on free plan with service ping data sharing enabled are not allowed to update their group IP allowlist [the form input is rendered, but updating the form and saving it doesn't update the value - as can be seen on the video in issue's description]. This MR aims to fix that.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
To validate this bug, we need to check the scenario for three different cases:
- a non-paid subscription user with service ping data sharing disabled: they should not be able to see or update the IP allowlist
- a non-paid subscription user with service ping data sharing enabled: they should be able to update the IP allowlist
- a paid subscription user: they should be able to update the IP allowlist
To modify the IP allowlist, go to a group > Settings > General > Permissions and group features > Restrict access by IP address, update its value and click Save changes
.
To enable Service Ping data sharing, go to Admin area > Settings > Metrics and profiling > Usage statistics and tick the Enable Service Ping
and Enable Registration Features
boxes.
As for simulating a non-paid subscription user, I don't know if there's a more elegant way to do it, but what I did was I just made #plan method return 'free'
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.