Assign roles programmatically
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), usery[0]);
UserLocalServiceUtil.addRoleUser(role.getRoleId(), user.getUserId());
UserLocalServiceUtil.updateUser(user);
UserLocalServiceUtil.addRoleUser(role.getRoleId(), user.getUserId());
UserLocalServiceUtil.updateUser(user);
No comments:
Post a Comment