File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 14
14
from sentry .api .api_publish_status import ApiPublishStatus
15
15
from sentry .api .base import region_silo_endpoint
16
16
from sentry .api .bases import OrganizationEndpoint
17
+ from sentry .api .endpoints .trace_explorer_ai_setup import OrganizationTraceExplorerAIPermission
17
18
from sentry .models .organization import Organization
18
19
from sentry .seer .seer_setup import get_seer_org_acknowledgement , get_seer_user_acknowledgement
19
20
from sentry .seer .signed_seer_api import sign_with_seer_secret
@@ -58,6 +59,8 @@ class TraceExplorerAIQuery(OrganizationEndpoint):
58
59
}
59
60
owner = ApiOwner .ML_AI
60
61
62
+ permission_classes = (OrganizationTraceExplorerAIPermission ,)
63
+
61
64
@staticmethod
62
65
def post (request : Request , organization : Organization ) -> Response :
63
66
"""
Original file line number Diff line number Diff line change 13
13
from sentry .api .api_publish_status import ApiPublishStatus
14
14
from sentry .api .base import region_silo_endpoint
15
15
from sentry .api .bases import OrganizationEndpoint
16
+ from sentry .api .bases .organization import OrganizationPermission
16
17
from sentry .models .organization import Organization
17
18
from sentry .seer .seer_setup import get_seer_org_acknowledgement , get_seer_user_acknowledgement
18
19
from sentry .seer .signed_seer_api import sign_with_seer_secret
22
23
from rest_framework .request import Request
23
24
24
25
26
+ class OrganizationTraceExplorerAIPermission (OrganizationPermission ):
27
+ scope_map = {
28
+ "POST" : ["org:read" ],
29
+ }
30
+
31
+
25
32
def fire_setup_request (org_id : int , project_ids : list [int ]) -> None :
26
33
"""
27
34
Sends a request to seer to create the initial cached prompt / setup the AI models
@@ -55,6 +62,8 @@ class TraceExplorerAISetup(OrganizationEndpoint):
55
62
}
56
63
owner = ApiOwner .ML_AI
57
64
65
+ permission_classes = (OrganizationTraceExplorerAIPermission ,)
66
+
58
67
@staticmethod
59
68
def post (request : Request , organization : Organization ) -> Response :
60
69
"""
You can’t perform that action at this time.
0 commit comments