use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method testDivergingAccesTypes.
@Test
public void testDivergingAccesTypes() {
// Test different access types
Permission pStored = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
Permission pRequested = DatasetPermission.onInstance(Ability.DOWNLOAD.asSet(), new DatasetId(DATASET1));
assert !pStored.implies(pRequested);
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method testDivergingInstances.
@Test
public void testDivergingInstances() {
// Test different Instances
Permission pStored = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
Permission pRequested = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET2));
assert !pStored.implies(pRequested);
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method permissionTypesFail.
@Test
public void permissionTypesFail() {
Permission dPerm = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
Permission qPerm = ExecutionPermission.onInstance(Ability.READ.asSet(), new ManagedExecutionId(new DatasetId(DATASET1), UUID.randomUUID()));
Permission sPerm = SuperPermission.onDomain();
Permission aPerm = AdminPermission.onDomain();
assertThat(dPerm.implies(qPerm)).isFalse();
assertThat(dPerm.implies(sPerm)).isFalse();
assertThat(aPerm.implies(sPerm)).isFalse();
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method testMultipleAccessesProhibit.
@Test
public void testMultipleAccessesProhibit() {
// Test different Instances
Permission pStored = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
Permission pRequested = DatasetPermission.onInstance(EnumSet.of(Ability.READ, Ability.DOWNLOAD), new DatasetId(DATASET1));
// Should not imply, since one access is missing
assert !pStored.implies(pRequested);
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method testEqual.
@Test
public void testEqual() {
// Test equal Permissions
Permission pStored = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
Permission pRequested = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
assert pStored.implies(pRequested);
}
Aggregations