Skip to content

Commit

Permalink
fix: give project_default_strategy_write the ability to update the de…
Browse files Browse the repository at this point in the history
…fault strategy (#8112)

This appears to have been an oversight in the original implementation
of this endpoint. This seems to be the primary point of this
permission. Additionally, the docs mention that this permission should
allow you to do just that.

Note: I've not added any tests for this, because we don't typically add
tests for it. If we have an example to follow, I'd be very happy to add
it, though
  • Loading branch information
thomasheartman authored Sep 6, 2024
1 parent 7e52da1 commit c1092ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/features/project-environments/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
type IUnleashServices,
serializeDates,
UPDATE_PROJECT,
PROJECT_DEFAULT_STRATEGY_WRITE,
} from '../../types';
import type { Logger } from '../../logger';
import type EnvironmentService from './environment-service';
Expand Down Expand Up @@ -105,7 +106,7 @@ export default class EnvironmentsController extends Controller {
method: 'post',
path: `${PREFIX}/:environment/default-strategy`,
handler: this.updateDefaultStrategyForProjectEnvironment,
permission: UPDATE_PROJECT,
permission: [UPDATE_PROJECT, PROJECT_DEFAULT_STRATEGY_WRITE],
middleware: [
openApiService.validPath({
tags: ['Projects'],
Expand Down

0 comments on commit c1092ba

Please sign in to comment.