Create helper allowing cookie restrictions to be controlled by feature flag
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Why
When hiding a feature behind a cookie flag we need a way to remove that restriction once the feature is ready. Doing this by changing the code couples it to the release process and might result in the need for a lengthy exception request process.
If instead we use a feature flag for disabling the restriction we can toggle it independently.
What
Create a helper method for creating a cookie restriction that can be turned off with a feature flag.
There are three possible states when using a cookie restriction:
- Feature requires cookie to be active
- Feature visible to all without needing a cookie
- Feature completely disabled
This helper should toggle between states (1) and (2), and could create a flag named something like cookie_restriction_for_#{feature_name}. If state three is desired another feature flag could be used.