@Test public void documentAccessIsDeniedOnFamilies() throws ComponentLookupException { Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, Right.VIEW, this.doc)); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, Right.COMMENT, this.doc)); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, Right.EDIT, this.doc)); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, Right.DELETE, this.doc)); Assert.assertFalse(this.mocker.getComponentUnderTest().hasAccess(this.user, ManageRight.MANAGE, this.doc)); }
@Override public Boolean hasAccess(User user, Right access, EntityReference entity) { if (!ObjectUtils.allNotNull(access, entity) || access.getTargetedEntityType() == null || !access.getTargetedEntityType().contains(EntityType.DOCUMENT)) { return null; } Family family = this.familyRepository.get(entity.toString()); if (family == null) { return null; } return false; }
DenyAccessByDefaultAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { if (!ObjectUtils.allNotNull(access, entity) || access.getTargetedEntityType() == null || !access.getTargetedEntityType().contains(EntityType.DOCUMENT)) { return null; } Family family = this.familyRepository.get(entity.toString()); if (family == null) { return null; } return false; } }
DenyAccessByDefaultAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { if (!ObjectUtils.allNotNull(access, entity) || access.getTargetedEntityType() == null || !access.getTargetedEntityType().contains(EntityType.DOCUMENT)) { return null; } Family family = this.familyRepository.get(entity.toString()); if (family == null) { return null; } return false; }  }
DenyAccessByDefaultAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { if (!ObjectUtils.allNotNull(access, entity) || access.getTargetedEntityType() == null || !access.getTargetedEntityType().contains(EntityType.DOCUMENT)) { return null; } Family family = this.familyRepository.get(entity.toString()); if (family == null) { return null; } return false; }  @Override int getPriority(); @Override Boolean hasAccess(User user, Right access, EntityReference entity); }
DenyAccessByDefaultAuthorizationModule implements AuthorizationModule { @Override public Boolean hasAccess(User user, Right access, EntityReference entity) { if (!ObjectUtils.allNotNull(access, entity) || access.getTargetedEntityType() == null || !access.getTargetedEntityType().contains(EntityType.DOCUMENT)) { return null; } Family family = this.familyRepository.get(entity.toString()); if (family == null) { return null; } return false; }  @Override int getPriority(); @Override Boolean hasAccess(User user, Right access, EntityReference entity);  }