@Test public void hasAccessLevel() { when(this.permissionsHelper.getCurrentUser()).thenReturn(COLLABORATOR); when(this.accessManager.getAccessLevel(this.entity, COLLABORATOR)).thenReturn(EDIT_ACCESS); when(this.visibilityManager.getVisibility(this.entity)).thenReturn(this.visibility); when(this.visibility.getDefaultAccessLevel()).thenReturn(VIEW_ACCESS); Assert.assertTrue(this.entityAccess.hasAccessLevel(VIEW_ACCESS)); Assert.assertTrue(this.entityAccess.hasAccessLevel(EDIT_ACCESS)); Assert.assertFalse(this.entityAccess.hasAccessLevel(MANAGE_ACCESS)); Assert.assertFalse(this.entityAccess.hasAccessLevel(OWNER_ACCESS)); }
@Override public boolean hasAccessLevel(@Nullable AccessLevel access) { return hasAccessLevel(this.helper.getCurrentUser(), access); }
DefaultEntityAccess implements EntityAccess { @Override public boolean hasAccessLevel(@Nullable AccessLevel access) { return hasAccessLevel(this.helper.getCurrentUser(), access); } }
DefaultEntityAccess implements EntityAccess { @Override public boolean hasAccessLevel(@Nullable AccessLevel access) { return hasAccessLevel(this.helper.getCurrentUser(), access); } DefaultEntityAccess(
        @Nullable final PrimaryEntity entity,
        @Nonnull final EntityAccessHelper helper,
        @Nonnull final EntityAccessManager accessManager,
        @Nonnull final EntityVisibilityManager visibilityManager); }
DefaultEntityAccess implements EntityAccess { @Override public boolean hasAccessLevel(@Nullable AccessLevel access) { return hasAccessLevel(this.helper.getCurrentUser(), access); } DefaultEntityAccess(
        @Nullable final PrimaryEntity entity,
        @Nonnull final EntityAccessHelper helper,
        @Nonnull final EntityAccessManager accessManager,
        @Nonnull final EntityVisibilityManager visibilityManager); @Nullable @Override PrimaryEntity getEntity(); @Nullable @Override Owner getOwner(); @Override boolean isOwner(); @Override boolean isOwner(@Nullable final EntityReference user); @Override boolean setOwner(@Nullable EntityReference userOrGroup); @Nonnull @Override Visibility getVisibility(); @Override boolean setVisibility(@Nullable Visibility newVisibility); @Nonnull @Override Collection<Collaborator> getCollaborators(); @Override boolean updateCollaborators(@Nullable Collection<Collaborator> newCollaborators); @Override boolean addCollaborator(@Nullable EntityReference user, @Nullable AccessLevel access); @Override boolean removeCollaborator(@Nullable EntityReference user); @Override boolean removeCollaborator(@Nullable Collaborator collaborator); @Nonnull @Override AccessLevel getAccessLevel(); @Nonnull @Override AccessLevel getAccessLevel(@Nullable EntityReference user); @Override boolean hasAccessLevel(@Nullable AccessLevel access); @Override boolean hasAccessLevel(@Nullable EntityReference user, @Nullable AccessLevel access); @Override String toString(); }
DefaultEntityAccess implements EntityAccess { @Override public boolean hasAccessLevel(@Nullable AccessLevel access) { return hasAccessLevel(this.helper.getCurrentUser(), access); } DefaultEntityAccess(
        @Nullable final PrimaryEntity entity,
        @Nonnull final EntityAccessHelper helper,
        @Nonnull final EntityAccessManager accessManager,
        @Nonnull final EntityVisibilityManager visibilityManager); @Nullable @Override PrimaryEntity getEntity(); @Nullable @Override Owner getOwner(); @Override boolean isOwner(); @Override boolean isOwner(@Nullable final EntityReference user); @Override boolean setOwner(@Nullable EntityReference userOrGroup); @Nonnull @Override Visibility getVisibility(); @Override boolean setVisibility(@Nullable Visibility newVisibility); @Nonnull @Override Collection<Collaborator> getCollaborators(); @Override boolean updateCollaborators(@Nullable Collection<Collaborator> newCollaborators); @Override boolean addCollaborator(@Nullable EntityReference user, @Nullable AccessLevel access); @Override boolean removeCollaborator(@Nullable EntityReference user); @Override boolean removeCollaborator(@Nullable Collaborator collaborator); @Nonnull @Override AccessLevel getAccessLevel(); @Nonnull @Override AccessLevel getAccessLevel(@Nullable EntityReference user); @Override boolean hasAccessLevel(@Nullable AccessLevel access); @Override boolean hasAccessLevel(@Nullable EntityReference user, @Nullable AccessLevel access); @Override String toString();  }