@Test public void defaultDecisionIsDeny() throws ComponentLookupException { doReturn(new LinkedList<>()).when(this.modules).get(); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, this.access, this.document)); }
@Override public boolean hasAccess(User user, Right access, EntityReference entity) { for (AuthorizationModule service : this.modules.get()) { try { Boolean decision = service.hasAccess(user, access, entity); if (decision != null) { return decision; } } catch (Exception ex) { this.logger.warn("Failed to invoke authorization service [{}]: {}", service.getClass().getCanonicalName(), ex.getMessage()); } } return false; }
DefaultAuthorizationService implements AuthorizationService { @Override public boolean hasAccess(User user, Right access, EntityReference entity) { for (AuthorizationModule service : this.modules.get()) { try { Boolean decision = service.hasAccess(user, access, entity); if (decision != null) { return decision; } } catch (Exception ex) { this.logger.warn("Failed to invoke authorization service [{}]: {}", service.getClass().getCanonicalName(), ex.getMessage()); } } return false; } }
DefaultAuthorizationService implements AuthorizationService { @Override public boolean hasAccess(User user, Right access, EntityReference entity) { for (AuthorizationModule service : this.modules.get()) { try { Boolean decision = service.hasAccess(user, access, entity); if (decision != null) { return decision; } } catch (Exception ex) { this.logger.warn("Failed to invoke authorization service [{}]: {}", service.getClass().getCanonicalName(), ex.getMessage()); } } return false; }  }
DefaultAuthorizationService implements AuthorizationService { @Override public boolean hasAccess(User user, Right access, EntityReference entity) { for (AuthorizationModule service : this.modules.get()) { try { Boolean decision = service.hasAccess(user, access, entity); if (decision != null) { return decision; } } catch (Exception ex) { this.logger.warn("Failed to invoke authorization service [{}]: {}", service.getClass().getCanonicalName(), ex.getMessage()); } } return false; }  @Override boolean hasAccess(User user, Right access, EntityReference entity); }
DefaultAuthorizationService implements AuthorizationService { @Override public boolean hasAccess(User user, Right access, EntityReference entity) { for (AuthorizationModule service : this.modules.get()) { try { Boolean decision = service.hasAccess(user, access, entity); if (decision != null) { return decision; } } catch (Exception ex) { this.logger.warn("Failed to invoke authorization service [{}]: {}", service.getClass().getCanonicalName(), ex.getMessage()); } } return false; }  @Override boolean hasAccess(User user, Right access, EntityReference entity);  }