Search in sources :

Example 96 with EntityType

use of org.molgenis.data.meta.model.EntityType in project molgenis by molgenis.

the class RepositorySecurityDecorator method count.

@Override
public long count() {
    EntityType entityType = delegate().getEntityType();
    validatePermission(entityType, EntityTypePermission.COUNT);
    return delegate().count();
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType)

Example 97 with EntityType

use of org.molgenis.data.meta.model.EntityType in project molgenis by molgenis.

the class RepositorySecurityDecorator method deleteAll.

@Override
public void deleteAll() {
    EntityType entityType = delegate().getEntityType();
    validatePermission(entityType, EntityTypePermission.WRITE);
    delegate().deleteAll();
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType)

Example 98 with EntityType

use of org.molgenis.data.meta.model.EntityType in project molgenis by molgenis.

the class RepositorySecurityDecorator method iterator.

@Override
public Iterator<Entity> iterator() {
    EntityType entityType = delegate().getEntityType();
    validatePermission(entityType, EntityTypePermission.READ);
    return delegate().iterator();
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType)

Example 99 with EntityType

use of org.molgenis.data.meta.model.EntityType in project molgenis by molgenis.

the class RepositorySecurityDecorator method delete.

@Override
public void delete(Entity entity) {
    EntityType entityType = delegate().getEntityType();
    validatePermission(entityType, EntityTypePermission.WRITE);
    delegate().delete(entity);
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType)

Example 100 with EntityType

use of org.molgenis.data.meta.model.EntityType in project molgenis by molgenis.

the class RepositorySecurityDecorator method add.

@Override
public Integer add(Stream<Entity> entities) {
    EntityType entityType = delegate().getEntityType();
    validatePermission(entityType, EntityTypePermission.WRITE);
    return delegate().add(entities);
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType)

Aggregations

EntityType (org.molgenis.data.meta.model.EntityType)581 Test (org.testng.annotations.Test)367 Attribute (org.molgenis.data.meta.model.Attribute)315 Entity (org.molgenis.data.Entity)98 AbstractMockitoTest (org.molgenis.test.AbstractMockitoTest)71 DynamicEntity (org.molgenis.data.support.DynamicEntity)61 Stream (java.util.stream.Stream)44 EntityTypeIdentity (org.molgenis.data.security.EntityTypeIdentity)43 WithMockUser (org.springframework.security.test.context.support.WithMockUser)40 AbstractMolgenisSpringTest (org.molgenis.data.AbstractMolgenisSpringTest)36 QueryImpl (org.molgenis.data.support.QueryImpl)33 Package (org.molgenis.data.meta.model.Package)32 Objects.requireNonNull (java.util.Objects.requireNonNull)22 Collectors.toList (java.util.stream.Collectors.toList)22 BeforeMethod (org.testng.annotations.BeforeMethod)20 AttributeType (org.molgenis.data.meta.AttributeType)19 List (java.util.List)17 String.format (java.lang.String.format)16 ExplainedAttribute (org.molgenis.semanticsearch.explain.bean.ExplainedAttribute)16 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)15