<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def protect_api(uuid=None, **kwargs):
 """Retrieve object and check permissions. Retrieve ObjectVersion of image being requested and check permission using the Invenio-Files-REST permission factory. """

    bucket, version_id, key = uuid.split(':', 2)
    g.obj = ObjectResource.get_object(bucket, key, version_id)
    return g.obj