use of io.joynr.accesscontrol.global.jee.persistence.OwnerAccessControlEntryEntity in project joynr by bmwcarit.
the class OwnerAccessControlEntryManagerTest method testRemove.
@Test
public void testRemove() {
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();
assertNotNull(subject.removeByUserIdDomainInterfaceNameAndOperation(userId, domain, interfaceName, operation));
flushAndClear();
OwnerAccessControlEntryEntity persisted = entityManager.find(OwnerAccessControlEntryEntity.class, entity.getId());
assertNull(persisted);
}
use of io.joynr.accesscontrol.global.jee.persistence.OwnerAccessControlEntryEntity in project joynr by bmwcarit.
the class OwnerAccessControlEntryManager method removeByUserIdDomainInterfaceNameAndOperation.
public OwnerAccessControlEntry removeByUserIdDomainInterfaceNameAndOperation(String userId, String domain, String interfaceName, String operation) {
if (!domainRoleEntryManager.hasCurrentUserGotRoleForDomain(Role.MASTER, domain)) {
return null;
}
OwnerAccessControlEntryEntity entity = findByUserIdDomainInterfaceNameAndOperation(userId, domain, interfaceName, operation);
OwnerAccessControlEntry removedEntry = null;
if (entity != null) {
entityManager.remove(entity);
removedEntry = mapEntityToJoynrType(entity);
}
return removedEntry;
}
Aggregations