(self, instance: Dict)
| 457 | return workspace_user_role_mapping_model is not None and role_permission_mapping_model is not None |
| 458 | |
| 459 | def list(self, instance: Dict): |
| 460 | self.is_valid(raise_exception=True) |
| 461 | workspace_id = self.data.get("workspace_id") |
| 462 | user_id = self.data.get("user_id") |
| 463 | req_dict = ApplicationQueryRequest(data=instance) |
| 464 | req_dict.is_valid(raise_exception=True) |
| 465 | workspace_manage = is_workspace_manage_permission_read(user_id, workspace_id, "APPLICATION:READ") |
| 466 | is_x_pack_ee = self.is_x_pack_ee() |
| 467 | return native_search( |
| 468 | self.get_query_set(req_dict.data, workspace_manage, is_x_pack_ee), |
| 469 | select_string=get_file_content( |
| 470 | os.path.join( |
| 471 | PROJECT_DIR, |
| 472 | "apps", |
| 473 | "application", |
| 474 | "sql", |
| 475 | "list_application.sql" |
| 476 | if workspace_manage |
| 477 | else ("list_application_user_ee.sql" if is_x_pack_ee else "list_application_user.sql"), |
| 478 | ) |
| 479 | ), |
| 480 | ) |
| 481 | |
| 482 | def page(self, current_page: int, page_size: int, instance: Dict): |
| 483 | self.is_valid(raise_exception=True) |
no test coverage detected