Add get_privileges() function for querying permissions