33from tracecat_registry import RegistrySecret
44
55from tracecat .auth .credentials import RoleACL
6- from tracecat .auth .types import AccessLevel , Role
6+ from tracecat .auth .types import Role
77from tracecat .authz .controls import require_scope
88from tracecat .db .dependencies import AsyncDBSession
99from tracecat .exceptions import RegistryError
2121
2222
2323@router .get ("" )
24- @require_scope ("workflow :read" )
24+ @require_scope ("org:registry :read" )
2525async def list_registry_actions (
2626 * ,
2727 role : Role = RoleACL (
@@ -45,7 +45,7 @@ async def list_registry_actions(
4545 response_model = RegistryActionRead ,
4646 response_model_exclude_unset = True ,
4747)
48- @require_scope ("workflow :read" )
48+ @require_scope ("org:registry :read" )
4949async def get_registry_action (
5050 * ,
5151 role : Role = RoleACL (
@@ -100,14 +100,13 @@ async def get_registry_action(
100100
101101
102102@router .post ("" , status_code = status .HTTP_201_CREATED )
103- @require_scope ("org:settings :manage" )
103+ @require_scope ("org:registry :manage" )
104104async def create_registry_action (
105105 * ,
106106 role : Role = RoleACL (
107107 allow_user = True ,
108108 allow_service = False ,
109109 require_workspace = "no" ,
110- min_access_level = AccessLevel .ADMIN ,
111110 ),
112111 session : AsyncDBSession ,
113112 params : RegistryActionCreate ,
@@ -130,14 +129,13 @@ async def create_registry_action(
130129
131130
132131@router .patch ("/{action_name}" , status_code = status .HTTP_204_NO_CONTENT )
133- @require_scope ("org:settings :manage" )
132+ @require_scope ("org:registry :manage" )
134133async def update_registry_action (
135134 * ,
136135 role : Role = RoleACL (
137136 allow_user = True ,
138137 allow_service = False ,
139138 require_workspace = "no" ,
140- min_access_level = AccessLevel .ADMIN ,
141139 ),
142140 session : AsyncDBSession ,
143141 params : RegistryActionUpdate ,
@@ -153,14 +151,13 @@ async def update_registry_action(
153151
154152
155153@router .delete ("/{action_name}" , status_code = status .HTTP_204_NO_CONTENT )
156- @require_scope ("org:settings :manage" )
154+ @require_scope ("org:registry :manage" )
157155async def delete_registry_action (
158156 * ,
159157 role : Role = RoleACL (
160158 allow_user = True ,
161159 allow_service = False ,
162160 require_workspace = "no" ,
163- min_access_level = AccessLevel .ADMIN ,
164161 ),
165162 session : AsyncDBSession ,
166163 action_name : str ,
0 commit comments