def on_unauthorized(object_id):
    permissions_by_user = get_object_permissions_for_users(object_id)
    has_grant_user = any(((Permissions.GRANT in permissions) for permissions in permissions_by_user.values()))
    return (flask.render_template('objects/unauthorized.html', object_id=object_id, has_grant_user=has_grant_user), 403)
def on_unauthorized(object_id):
    permissions_by_user = get_object_permissions_for_users(object_id)
    has_grant_user = any(((Permissions.GRANT in permissions) for permissions in permissions_by_user.values()))
    return (flask.render_template('objects/unauthorized.html', object_id=object_id, has_grant_user=has_grant_user), 403)