def is_image_visible(context, image, status=None):
 if context.is_admin:
  return True
 if (image['owner'] is None):
  return True
 if (image['visibility'] in ['public', 'community']):
  return True
 if (context.owner is not None):
  if (context.owner == image['owner']):
   return True
  if ('shared' == image['visibility']):
   members = image_member_find(context, image_id=image['id'], member=context.owner, status=status)
   if members:
    return True
 return False

def is_image_visible ( context , image , status = None ) : if context . is_admin : return True if ( image [ 'owner' ] is None ) : return True if ( image [ 'visibility' ] in [ 'public' , 'community' ] ) : return True if ( context . owner is not None ) : if ( context . owner == image [ 'owner' ] ) : return True if ( 'shared' == image [ 'visibility' ] ) : members = image_member_find ( context , image_id = image [ 'id' ] , member = context . owner , status = status ) if members : return True return False
return true if the image is visible in this context .