You must have EXECUTE FUNCTION privileges on the function or on the database containing the function.