@Test public void configurationIsSupported() throws ComponentLookupException { ConfigurationSource config = this.mocker.getInstance(ConfigurationSource.class, "restricted"); when(config.getProperty("phenotips.security.authorization.allowAllAccessByDefault")).thenReturn(Boolean.TRUE); Assert.assertTrue(this.mocker.getComponentUnderTest().hasAccess(this.user, this.right, this.doc)); when(config.getProperty("phenotips.security.authorization.allowAllAccessByDefault")).thenReturn(Boolean.FALSE); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, this.right, this.doc)); }
@Override public Boolean hasAccess(User user, Right access, EntityReference entity) { Boolean result = this.configuration.getProperty("phenotips.security.authorization.allowAllAccessByDefault"); if (result == null) { result = Boolean.FALSE; } return result; }
BaseAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { Boolean result = this.configuration.getProperty("phenotips.security.authorization.allowAllAccessByDefault"); if (result == null) { result = Boolean.FALSE; } return result; } }
BaseAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { Boolean result = this.configuration.getProperty("phenotips.security.authorization.allowAllAccessByDefault"); if (result == null) { result = Boolean.FALSE; } return result; }  }
BaseAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { Boolean result = this.configuration.getProperty("phenotips.security.authorization.allowAllAccessByDefault"); if (result == null) { result = Boolean.FALSE; } return result; }  @Override int getPriority(); @Override Boolean hasAccess(User user, Right access, EntityReference entity); }
BaseAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { Boolean result = this.configuration.getProperty("phenotips.security.authorization.allowAllAccessByDefault"); if (result == null) { result = Boolean.FALSE; } return result; }  @Override int getPriority(); @Override Boolean hasAccess(User user, Right access, EntityReference entity);  }