Add Flag Prerequisites
This topic describes how to use feature flag prerequisites to enable or disable features based on different flag states.
Prerequisites allow you to add a flag as a dependency to enable a feature. You can add any other existing flags from your environment as a prerequisite. When you add a flag prerequisite, the state of a flag will not come into an effect unless the prerequisites are met.
For example, you have two flags that control read and write access in your Java code,
Read Java and
Write Java. If you do not have read access to your codebase, you will not be able to view the code, hence will not be able to write to it.
You can set
Read Java as a prerequisite to
Write Java flag. When evaluating the
Write Java flag, Harnes Feature Flag will ensure that the
Read Java flag is
On and the user is seeing the
Before You Begin
Step: Add Prerequisites
Perform the following steps to add flag prerequisites:
- Click on the feature flag for which you want to add the prerequisites.
- Expand Prerequisites(what’s required before enabling flags) and click Prerequisites.
- In Add Prerequisites, click Prerequisites.
- Select a flag and variation from the drop-down list and click Save.The added prerequisite is listed.