def get_record_collections(recid):
try:<EOL><INDENT>from invenio.search_engine import (<EOL>get_all_collections_of_a_record,<EOL>get_restricted_collections_for_recid)<EOL><DEDENT>except ImportError:<EOL><INDENT>from invenio.legacy.search_engine import (<EOL>get_all_collections_of_a_record,<EOL>get_restricted_collections_for_recid)<EOL><DEDENT>collections = {<EOL>'<STR_LIT:all>':<EOL>get_all_collections_of_a_record(recid, recreate_cache_if_needed=False),<EOL>}<EOL>collections['<STR_LIT>'] = dict(<EOL>(coll, _get_collection_restrictions(coll))<EOL>for coll in get_restricted_collections_for_recid(<EOL>recid, recreate_cache_if_needed=False))<EOL>return collections<EOL>
Get all collections the record belong to.