Use getSpaces with SpacesQuery rather than deprecated getPermittedSpaces...

`spaceDao.getPermittedSpacesForUser` has been deprecated since Confluence 3, and was finally removed in 5.2, breaking functionality for non-superadmins when they try to change permissions. Using `spaceDao.getSpaces` with a `SpacesQuery` fixes the issue (tested locally and works, but may need further testing).