'Scans all RBAC tables for an ID to figure out the type.
This will be an expensive operation as the number of RBAC tables grows.
The result is cached since object types cannot be updated for a policy.'

def _get_object_type(self, context, entry_id):

    if (entry_id in self.object_type_cache):
        return self.object_type_cache[entry_id]
    for (otype, model) in models.get_type_model_map().items():
        if context.session.query(model).filter((model.id == entry_id)).first():
            self.object_type_cache[entry_id] = otype
            return otype
    raise ext_rbac.RbacPolicyNotFound(id=entry_id, object_type='unknown')
