Get cube by ID. Args: cube_id (str): The cube ID. Returns: Cube: The cube object or None if not found.
(self, cube_id: str)
| 288 | session.close() |
| 289 | |
| 290 | def get_cube(self, cube_id: str) -> Cube | None: |
| 291 | """Get cube by ID. |
| 292 | |
| 293 | Args: |
| 294 | cube_id (str): The cube ID. |
| 295 | |
| 296 | Returns: |
| 297 | Cube: The cube object or None if not found. |
| 298 | """ |
| 299 | session = self._get_session() |
| 300 | try: |
| 301 | return session.query(Cube).filter(Cube.cube_id == cube_id).first() |
| 302 | finally: |
| 303 | session.close() |
| 304 | |
| 305 | def validate_user_cube_access(self, user_id: str, cube_id: str) -> bool: |
| 306 | """Validate if a user has access to a cube. |