Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
I want to add a role to user when he visits a specific page only
I'm trying to create a portlet with render request that will add role
to a user when he visits a specific page as a page reviewer. This page
will be assigned to him based on a specific roles. I'm facing an issue
on my code, I used
RoleLocalServiceUtil.addUserRole(themeDisplay.getUserId(),
PageReviewerId) the issue that it gives the role and save it in user
roles which I don't require. I only wanted to save this role only when
he visits a specific page. I will need some suggestions on how to
accomplish this?
I'm thinking of
user RoleLocalServiceUtil.createRole(3333) I'm not sure if this will work.
Community
Company
Feedback