1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/src/lib
Gastón Fournier c5afa8ff11
fix: unauthorized disable feature (#5982)
## About the changes
This was spotted while testing automated actions. Steps to reproduce:

1. Add an editor user
2. Get a PAT for the editor user
3. As Admin create a feature in a project where the editor user is not a
member and enable the feature
4. Try using the editor's PAT to modify the feature
5. As the editor create a project (you'd be made owner) and try the same
request but just change the project name for the new project just
created (don't change anything else)

**Expected behavior**: you can't disable the feature
**Actual behavior**: the feature is disabled

This does not happen when trying to turn on a flag because during the
turn-on process we do validate if the feature belongs to project when we
call updateStrategy:
c18a7c0dc2/src/lib/features/feature-toggle/feature-toggle-service.ts (L1751-L1764)
2024-01-22 12:50:14 +01:00
..
__snapshots__ Executive Dashboard page setup (#5949) 2024-01-18 12:32:25 +01:00
addons
db chore: re use extract user methods (#5947) 2024-01-18 13:15:21 +01:00
domain/project-health fix(import): making all imports relative and removing baseUrl (#5847) 2024-01-17 15:33:03 +02:00
error
features fix: unauthorized disable feature (#5982) 2024-01-22 12:50:14 +01:00
middleware chore: add types to pat middleware (#5951) 2024-01-18 14:36:42 +01:00
openapi feat: Prometheus last day metrics (#5878) 2024-01-15 15:31:38 +01:00
proxy
routes chore: re use extract user methods (#5947) 2024-01-18 13:15:21 +01:00
schema
segments fix(import): making all imports relative and removing baseUrl (#5847) 2024-01-17 15:33:03 +02:00
services fix: unauthorized disable feature (#5982) 2024-01-22 12:50:14 +01:00
types chore: re use extract user methods (#5947) 2024-01-18 13:15:21 +01:00
util refactor: add typesafe wrappers for prom client metrics (#5969) 2024-01-19 14:51:29 +00:00
app.test.ts
app.ts
create-config.test.ts
create-config.ts feat: metrics periods expressed in days (#5928) 2024-01-18 11:54:20 +01:00
default-custom-auth-deny-all.ts
internals.ts
logger.test.ts
logger.ts
metric-events.ts
metrics.test.ts
metrics.ts refactor: add typesafe wrappers for prom client metrics (#5969) 2024-01-19 14:51:29 +00:00
server-impl.test.ts
server-impl.ts