Avoid duplicating code: use user_get_all_accessible_projects api