AccessResource extends AbstractBrooklynRestResource implements AccessApi { @Override public AccessSummary get() { AccessManager accessManager = mgmtInternal().getAccessManager(); return AccessTransformer.accessSummary(accessManager, ui.getBaseUriBuilder()); }  @Override AccessSummary get(); @Override Response locationProvisioningAllowed(boolean allowed);  }
@Test public void testGetAndSetAccessControl() throws Exception { AccessSummary summary = client().path("/access").get(AccessSummary.class); assertTrue(summary.isLocationProvisioningAllowed()); Response response = client().path("/access/locationProvisioningAllowed") .query("allowed", "false") .post(null); assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); AccessSummary summary2 = client().path("/access").get(AccessSummary.class); assertFalse(summary2.isLocationProvisioningAllowed()); Response response2 = client().path("/access/locationProvisioningAllowed") .query("allowed", "true") .post(null); assertEquals(response2.getStatus(), Response.Status.OK.getStatusCode()); AccessSummary summary3 = client().path("/access").get(AccessSummary.class); assertTrue(summary3.isLocationProvisioningAllowed()); }