1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

fix: give project_default_strategy_write the ability to update the default 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
This commit is contained in:
Thomas Heartman 2024-09-06 11:49:11 +02:00 committed by GitHub
parent 7e52da11bc
commit c1092bacf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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';
@ -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'],