def get_acl_objects_by_model(self, user, model, permission):
        """
        return all objects of the specified model for which user "user" have permission "permission"
        """
        contenttype = ContentType.objects.get_for_model(model)

        ret = []
        user_id = 0 if user.is_anonymous() else user.id
        acl_users_permissions = cache.get(ACL_USERS_PERMISSIONS_CACHE)
        if acl_users_permissions is None:
            acl_users_permissions = self.cache_user_permissions(user)
        else:
            try:
                acl_users_permissions[user_id]
            except __HOLE__:
                acl_users_permissions = self.cache_user_permissions(user)
        try:
            for obj, perm in acl_users_permissions[user_id][contenttype.id].iteritems():
                try:
                    if perm[permission]:
                        ret.append(obj)
                except:
                    pass
        except:
            pass
        return ret
dataset/ETHPy150Open zorna/zorna/zorna/acl/models.py/ACLPermissionManager.get_acl_objects_by_model