Check for predict-edits
feature flag, remove is_staff
check (#23165)
Release Notes: - N/A --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
da8e65b3e5
commit
4a7630204a
6 changed files with 21 additions and 11 deletions
|
@ -440,8 +440,11 @@ async fn predict_edits(
|
|||
_country_code_header: Option<TypedHeader<CloudflareIpCountryHeader>>,
|
||||
Json(params): Json<PredictEditsParams>,
|
||||
) -> Result<impl IntoResponse> {
|
||||
if !claims.is_staff {
|
||||
return Err(anyhow!("not found"))?;
|
||||
if !claims.is_staff && !claims.has_predict_edits_feature_flag {
|
||||
return Err(Error::http(
|
||||
StatusCode::FORBIDDEN,
|
||||
"no access to Zed's edit prediction feature".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
let api_url = state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue