Search in sources :

Example 1 with Tenant

use of com.odysseusinc.arachne.portal.model.security.Tenant in project ArachneCentralAPI by OHDSI.

the class BaseUserServiceImpl method setActiveTenant.

@Override
public void setActiveTenant(U user, Long tenantId) {
    for (Tenant t : user.getTenants()) {
        if (t.getId().equals(tenantId)) {
            user.setActiveTenant(t);
            userRepository.save(user);
            return;
        }
    }
    throw new NotExistException(Tenant.class);
}
Also used : Tenant(com.odysseusinc.arachne.portal.model.security.Tenant) NotExistException(com.odysseusinc.arachne.portal.exception.NotExistException)

Aggregations

NotExistException (com.odysseusinc.arachne.portal.exception.NotExistException)1 Tenant (com.odysseusinc.arachne.portal.model.security.Tenant)1