Skip to content

Commit 1bd1f3c

Browse files
authored
fix(objectstore): Use OrganizationReleasePermission for Objectstore endpoint (#109865)
1 parent e6c91d9 commit 1bd1f3c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/sentry/objectstore/endpoints/organization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from sentry.api.api_publish_status import ApiPublishStatus
2626
from sentry.api.base import region_silo_endpoint
2727
from sentry.api.bases import OrganizationEndpoint
28+
from sentry.api.bases.organization import OrganizationReleasePermission
2829
from sentry.models.organization import Organization
2930
from sentry.objectstore import parse_accept_encoding
3031

@@ -38,6 +39,7 @@ class OrganizationObjectstoreEndpoint(OrganizationEndpoint):
3839
"DELETE": ApiPublishStatus.EXPERIMENTAL,
3940
}
4041
owner = ApiOwner.FOUNDATIONAL_STORAGE
42+
permission_classes = (OrganizationReleasePermission,)
4143
parser_classes = () # don't attempt to parse request data, so we can access the raw body in wsgi.input
4244

4345
def _check_flag(self, request: Request, organization: Organization) -> Response | None:

tests/sentry/objectstore/endpoints/test_organization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def setUp(self) -> None:
4040
self.organization = self.create_organization(owner=self.user)
4141
self.api_key = self.create_api_key(
4242
organization=self.organization,
43-
scope_list=["org:admin"],
43+
scope_list=["project:releases"],
4444
)
4545

4646
def get_endpoint_url(self) -> str:
@@ -177,7 +177,7 @@ def setUp(self) -> None:
177177
self.organization = self.create_organization(owner=self.user)
178178
self.api_key = self.create_api_key(
179179
organization=self.organization,
180-
scope_list=["org:admin"],
180+
scope_list=["project:releases"],
181181
)
182182

183183
def tearDown(self) -> None:

0 commit comments

Comments
 (0)