Commit 994c02bf authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'rw/add-selective-ff-override-tip-to-docs' into 'master'

Add docs for selectively disabling a feature flag

See merge request gitlab-org/gitlab!51740
parents 86d63257 db2629e1
......@@ -321,6 +321,28 @@ Feature.enabled?(:feature_flag, group)
Feature.enabled?(:feature_flag, user)
```
#### Selectively disable by actor
By default you cannot selectively disable a feature flag by actor.
```shell
# This will not work how you would expect.
/chatops run feature set some_feature true
/chatops run feature set --project=gitlab-org/gitlab some_feature false
```
However, if you add two feature flags, you can write your conditional statement in such a way that the equivalent selective disable is possible.
```ruby
Feature.enabled?(:a_feature, project) && Feature.disabled?(:a_feature_override, project)
```
```shell
# This will enable a feature flag globally, except for gitlab-org/gitlab
/chatops run feature set a_feature true
/chatops run feature set --project=gitlab-org/gitlab a_feature_override true
```
### Enable additional objects as actors
To use feature gates based on actors, the model needs to respond to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment