use of joynr.infrastructure.DacTypes.OwnerAccessControlEntry in project joynr by bmwcarit.
the class AccessControlAlgorithmTest method setup.
@Before
public void setup() {
this.accessControlAlgorithm = new AccessControlAlgorithm();
masterAce = new MasterAccessControlEntry(UID, DOMAIN, INTERFACE, TrustLevel.LOW, allTrustLevels, TrustLevel.LOW, allTrustLevels, null, Permission.NO, allPermissions);
mediatorAce = new MasterAccessControlEntry(UID, DOMAIN, INTERFACE, TrustLevel.LOW, allTrustLevels, TrustLevel.LOW, allTrustLevels, null, Permission.NO, allPermissions);
ownerAce = new OwnerAccessControlEntry(UID, DOMAIN, INTERFACE, TrustLevel.LOW, TrustLevel.LOW, null, Permission.NO);
}
use of joynr.infrastructure.DacTypes.OwnerAccessControlEntry in project joynr by bmwcarit.
the class GlobalDomainAccessControlListEditorBean method updateOwnerAccessControlEntry.
@Override
public Boolean updateOwnerAccessControlEntry(OwnerAccessControlEntry updatedOwnerAce) {
CreateOrUpdateResult<OwnerAccessControlEntry> result = ownerAccessControlEntryManager.createOrUpdate(updatedOwnerAce);
if (result != null) {
OwnerAccessControlEntry entry = result.getEntry();
globalDomainAccessControllerBean.doFireOwnerAccessControlEntryChanged(result.getChangeType(), entry);
return true;
}
return false;
}
use of joynr.infrastructure.DacTypes.OwnerAccessControlEntry in project joynr by bmwcarit.
the class GlobalDomainAccessControlListEditorBeanTest method testCreateOwnerAccessControlEntry.
@Test
public void testCreateOwnerAccessControlEntry() {
OwnerAccessControlEntry oace = new OwnerAccessControlEntry(USER_ID, DOMAIN, INTERFACE_NAME, TrustLevel.HIGH, TrustLevel.LOW, OPERATION, Permission.YES);
CreateOrUpdateResult<OwnerAccessControlEntry> createResult = new CreateOrUpdateResult<>(oace, ChangeType.ADD);
when(ownerAccessControlEntryManagerMock.createOrUpdate(oace)).thenReturn(createResult);
Boolean result = globalDomainAccessControlListEditorSubject.updateOwnerAccessControlEntry(oace);
assertEquals(Boolean.TRUE, result);
verify(ownerAccessControlEntryManagerMock).createOrUpdate(eq(oace));
verify(globalDomainAccessControllerBeanMock).doFireOwnerAccessControlEntryChanged(eq(ChangeType.ADD), eq(oace));
}
use of joynr.infrastructure.DacTypes.OwnerAccessControlEntry in project joynr by bmwcarit.
the class GlobalDomainAccessControlListEditorBeanTest method testUpdateOwnerAccessControlEntry.
@Test
public void testUpdateOwnerAccessControlEntry() {
OwnerAccessControlEntry oace = new OwnerAccessControlEntry(USER_ID, DOMAIN, INTERFACE_NAME, TrustLevel.HIGH, TrustLevel.LOW, OPERATION, Permission.YES);
CreateOrUpdateResult<OwnerAccessControlEntry> createResult = new CreateOrUpdateResult<>(oace, ChangeType.UPDATE);
when(ownerAccessControlEntryManagerMock.createOrUpdate(oace)).thenReturn(createResult);
Boolean result = globalDomainAccessControlListEditorSubject.updateOwnerAccessControlEntry(oace);
assertEquals(Boolean.TRUE, result);
verify(ownerAccessControlEntryManagerMock).createOrUpdate(eq(oace));
verify(globalDomainAccessControllerBeanMock).doFireOwnerAccessControlEntryChanged(eq(ChangeType.UPDATE), eq(oace));
}
use of joynr.infrastructure.DacTypes.OwnerAccessControlEntry in project joynr by bmwcarit.
the class OwnerAccessControlEntryManagerTest method testRemoveNotAllowed.
@Test
public void testRemoveNotAllowed() {
String userId = "userId";
String domain = "domain";
String interfaceName = "interfaceName";
String operation = "operation";
OwnerAccessControlEntryEntity entity = create(userId, domain, interfaceName, TrustLevel.MID, TrustLevel.HIGH, operation, Permission.YES);
flushAndClear();
OwnerAccessControlEntry result = null;
JoynrJeeMessageContext.getInstance().activate();
try {
joynrCallingPrincipal.setUsername(userId);
result = subject.removeByUserIdDomainInterfaceNameAndOperation(userId, domain, interfaceName, operation);
} finally {
JoynrJeeMessageContext.getInstance().deactivate();
}
assertNull(result);
flushAndClear();
OwnerAccessControlEntryEntity persisted = entityManager.find(OwnerAccessControlEntryEntity.class, entity.getId());
assertNotNull(persisted);
}
Aggregations