MCPcopy Create free account
hub / github.com/MemTensor/MemOS / _validate_cube_access

Method _validate_cube_access

src/memos/mem_os/core.py:214–231  ·  view source on GitHub ↗

Validate user has access to the cube. Args: user_id (str): The user ID to validate. cube_id (str): The cube ID to validate. Raises: ValueError: If user doesn't have access to the cube.

(self, user_id: str, cube_id: str)

Source from the content-addressed store, hash-verified

212 )
213
214 def _validate_cube_access(self, user_id: str, cube_id: str) -> None:
215 """Validate user has access to the cube.
216
217 Args:
218 user_id (str): The user ID to validate.
219 cube_id (str): The cube ID to validate.
220
221 Raises:
222 ValueError: If user doesn't have access to the cube.
223 """
224 # First validate user exists
225 self._validate_user_exists(user_id)
226
227 # Then validate cube access
228 if not self.user_manager.validate_user_cube_access(user_id, cube_id):
229 raise ValueError(
230 f"User '{user_id}' does not have access to cube '{cube_id}'. Please register the cube first or request access."
231 )
232
233 def _get_all_documents(self, path: str) -> list[str]:
234 """Get all documents from path.

Callers 7

addMethod · 0.95
getMethod · 0.95
get_allMethod · 0.95
updateMethod · 0.95
deleteMethod · 0.95
delete_allMethod · 0.95
share_cube_with_userMethod · 0.95

Calls 2

_validate_user_existsMethod · 0.95

Tested by

no test coverage detected