Reorder get_privileges() arguments and add privilege assignment API