Enable Campaigns by default (with write-access only for admins)
Created by: mrnugget
This fixes https://github.com/sourcegraph/sourcegraph/issues/10713 by deprecating all the previous feature flags related to campaigns and replacing them with campaigns.enabled: Boolean
.
By default, the value of campaigns.enabled
is true so that campaigns are enabled for everybody, including non-site-admins.
But, in order to allow us to safely merge this while we're still working on campaigns, I left in the safety switch that prohibits users from creating changeset specs and campaign specs.
That means:
- By default site-admins can create/manage/view campaigns
- By default all users can view campaigns
When campaigns.enabled
is set to false
:
- site-admins cannot create/manage/view campaigns
- users cannot view campaigns
In order to then allow users to create/manage campaigns, all we need to do is to remove the two checks in CreateChangesetSpec
/CreateCampaignSpec
in campaigns/resolvers/resolver.go
. The checks also have tests that can be removed.