use of joynr.infrastructure.DacTypes.Permission in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method testPermissionMessageTrustLevelDoesntMatchAce.
@Test
public void testPermissionMessageTrustLevelDoesntMatchAce() {
masterAce.setDefaultConsumerPermission(Permission.YES);
masterAce.setDefaultRequiredTrustLevel(TrustLevel.MID);
Permission consumerPermission = accessControlAlgorithm.getConsumerPermission(masterAce, null, null, TrustLevel.LOW);
Assert.assertEquals(Permission.NO, consumerPermission);
}
use of joynr.infrastructure.DacTypes.Permission in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method testPermissionWithMasterAndMediatorAce.
// ------ Mediator overrides master with -----------------------------
@Test
public void testPermissionWithMasterAndMediatorAce() {
masterAce.setDefaultConsumerPermission(Permission.YES);
masterAce.setDefaultRequiredTrustLevel(TrustLevel.HIGH);
masterAce.setPossibleConsumerPermissions(allPermissions);
masterAce.setPossibleRequiredTrustLevels(allTrustLevels);
mediatorAce.setDefaultConsumerPermission(Permission.ASK);
mediatorAce.setDefaultRequiredTrustLevel(TrustLevel.LOW);
Permission providerPermission = accessControlAlgorithm.getConsumerPermission(masterAce, mediatorAce, null, TrustLevel.LOW);
Assert.assertEquals(Permission.ASK, providerPermission);
}
use of joynr.infrastructure.DacTypes.Permission in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method testPermissionWithMediatorAndInvalidOwnerAce.
@Test
public void testPermissionWithMediatorAndInvalidOwnerAce() {
mediatorAce.setPossibleConsumerPermissions(new Permission[] { Permission.NO });
ownerAce.setConsumerPermission(Permission.ASK);
Permission consumerPermission = accessControlAlgorithm.getConsumerPermission(null, mediatorAce, ownerAce, TrustLevel.HIGH);
Assert.assertEquals(Permission.NO, consumerPermission);
}
use of joynr.infrastructure.DacTypes.Permission in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method testPermissionWithMediatorOnly.
@Test
public void testPermissionWithMediatorOnly() {
mediatorAce.setDefaultConsumerPermission(Permission.YES);
mediatorAce.setDefaultRequiredTrustLevel(TrustLevel.MID);
Permission providerPermission = accessControlAlgorithm.getConsumerPermission(null, mediatorAce, null, TrustLevel.HIGH);
Assert.assertEquals(Permission.YES, providerPermission);
}
use of joynr.infrastructure.DacTypes.Permission in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method testPermissionWithMasterAndOwnerAce.
@Test
public void testPermissionWithMasterAndOwnerAce() {
masterAce.setDefaultConsumerPermission(Permission.ASK);
masterAce.setDefaultRequiredTrustLevel(TrustLevel.LOW);
ownerAce.setConsumerPermission(Permission.YES);
ownerAce.setRequiredTrustLevel(TrustLevel.HIGH);
Permission consumerPermission = accessControlAlgorithm.getConsumerPermission(masterAce, null, ownerAce, TrustLevel.HIGH);
Assert.assertEquals(Permission.YES, consumerPermission);
}
Aggregations