Example usage for com.liferay.portal.kernel.model User hasCompanyMx

List of usage examples for com.liferay.portal.kernel.model User hasCompanyMx

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model User hasCompanyMx.

Prototype

public boolean hasCompanyMx() throws com.liferay.portal.kernel.exception.PortalException;

Source Link

Usage

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularUserServiceImpl.java

License:Open Source License

protected void validateEmail(String emailAddress, User user) throws PortalException {

    if (user != null && !user.hasCompanyMx() && user.hasCompanyMx(emailAddress)) {
        Company company = CompanyLocalServiceUtil.getCompany(user.getCompanyId());

        if (!company.isStrangersWithMx()) {
            throw new UserEmailAddressException.MustNotUseCompanyMx(emailAddress);
        }/*from  w w w . j av  a 2s  . com*/
    }
}