I have a requirement that the site owner has permission to create the users and able to view the list of users only created by him.
To achieve the same I have created a portlet which has the form with basic user details. While submitting the form in my action class, I am inserting the user details in USER_ table by calling the following method:
try{
UserLocalServiceUtil.addUser(creatorUserId, companyId, autoPassword, password1, password2,
autoScreenName, screenName, emailAddress, facebookId, openId, locale, firstName, middleName, lastName,
prefixId, suffixId, male, birthdayMonth,birthdayDay, birthdayYear, jobTitle, groupIds,
organizationsIds, roleIds, userGroupIds, sendEmail, serviceContext);
}
catch(Exception e)
{
}
int userCount = UserLocalServiceUtil.getUsersCount();
Now the users are creating in USER_ table. But while displaying the list of users I need to display only the users created by that site owner only.
So I want to insert one more column like siteId
along with the users table and while fetching based on the siteId
I want to optimize the list and display on UI.
So I have gone through the Expando concept but I didn't get proper idea how can I use it based on my requirement.
So any one please suggest me how can I insert 'siteId' while calling the addUser
method and while fetching the based on this siteID
need to get the users list.
Thanks in advance.