File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/ai/backend/manager/repositories/permission_controller Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,10 @@ async def check_scope_permission_exist(
140140 scope_id : ScopeId ,
141141 operation : OperationType ,
142142 ) -> bool :
143- role_query = (
144- sa .select (sa . func . exist () )
143+ exist_query = sa . exists (
144+ sa .select (1 )
145145 .select_from (
146- sa .join (UserRoleRow , RoleRow .id == UserRoleRow .role_id )
146+ sa .join (UserRoleRow , RoleRow , RoleRow .id == UserRoleRow .role_id )
147147 .join (PermissionGroupRow , RoleRow .id == PermissionGroupRow .role_id )
148148 .join (PermissionRow , PermissionGroupRow .id == PermissionRow .permission_group_id )
149149 )
@@ -158,12 +158,8 @@ async def check_scope_permission_exist(
158158 PermissionRow .operation == operation ,
159159 )
160160 )
161- .options (
162- contains_eager (RoleRow .permission_group_rows ).options (
163- selectinload (PermissionGroupRow .permission_rows )
164- )
165- )
166161 )
162+ role_query = sa .select (exist_query )
167163 async with self ._db .begin_readonly_session () as db_session :
168164 result = await db_session .scalar (role_query )
169165 return result
You can’t perform that action at this time.
0 commit comments