Search code examples
liferayorganization

Liferay auto assign users to an organization on register


How do I auto-assign a user to an organization when they register to a liferay portal?


Solution

  • You can automatically assign new users to sites, roles and user groups, but not organizations. Anyway, there are surely many ways to achieve what you want with just a few lines of code.

    For example, you can develop a hook plugin which overrides the addUserWithWorkflow method of the UserLocalService service, so you can add a new organization ID to the organizationIds parameter before calling super.addUserWithWorkflow(...).

    Hope it helps!