added permissions query fixes, removed isAdmin method.