That might be a good candidate for the upcoming XBlock services. Currently as far as I know this can only be accessed through the xmodule runtime, but that could be something to answer to Ned in https://groups.google.com/forum/#!topic/edx-code/yDIfxjj8xTo -- I'm planning to make a general answer to this for stuff that we need in various XBlocks, I can mention the course_id (which we also need for mentoring).