use of com.liferay.portal.CompanyMaxUsersException in project liferay-ide by liferay.
the class UserLocalServiceImpl method validateCompanyMaxUsers.
protected void validateCompanyMaxUsers(long companyId) throws PortalException, SystemException {
Company company = companyPersistence.findByPrimaryKey(companyId);
if (company.isSystem() || (company.getMaxUsers() == 0)) {
return;
}
int userCount = searchCount(companyId, null, WorkflowConstants.STATUS_APPROVED, null);
if (userCount >= company.getMaxUsers()) {
throw new CompanyMaxUsersException();
}
}
Aggregations