def get(self, asset_id): """ Retrieve all task types related to a given asset. """ asset = assets_service.get_asset(asset_id) user_service.check_project_access(asset["project_id"]) return tasks_service.get_task_types_for_asset(asset_id)
def get(self, asset_id): """ Retrieve all task types related to a given asset. """ asset = assets_service.get_asset(asset_id) if not permissions.has_manager_permissions(): user_service.check_has_task_related(asset["project_id"]) return tasks_service.get_task_types_for_asset(asset_id)
def get(self, asset_id): """ Retrieve all task types related to a given asset. --- tags: - Assets parameters: - in: path name: asset_id required: True schema: type: UUID example: a24a6ea4-ce75-4665-a070-57453082c25 responses: 200: description: All task types related to given asset """ asset = assets_service.get_asset(asset_id) user_service.check_project_access(asset["project_id"]) return tasks_service.get_task_types_for_asset(asset_id)
def test_get_task_types_for_entity(self): task_types = tasks_service.get_task_types_for_asset(self.entity.id) self.assertEqual(len(task_types), 1) self.assertEqual(task_types[0]["id"], str(self.task_type.id))