Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Krzysztof Gołębiowski
Portal Content Reviewer role within user Personal Site
May 11, 2012 2:44 AM
Answer

Krzysztof Gołębiowski

Rank: Expert

Posts: 349

Join Date: June 25, 2011

Recent Posts

Hello Commuity,
I had an interesting issue recently, associated with Kaleo and UserGroupRoles. We are using Kaleo Web Workflow (Single Approver process) for Guest user comments on Blogs ang Message Boards. I had the following requirement: each portal user, can create a private blog and turn on comments moderation queue with two single clicks. Enabling Blog and Workflow is simple, but ... there is a problem with Site Content Reviewer role assignment. Liferay user interface does not allow to assign site roles to user private sites (I cannot assign regular role Portal Content Reviewer as I don't want private user to moderate portal blog/message board queues).

First I've done it programmatically with Site Content Reviewer Role: UserGroupRoleServiceUtil.addUserGroupRoles(userId, userPersonalSiteGroupId, new long[] {siteContentReviewerRoleId}). It didn't work, user haven't seen any workflow tasks. Next, I've done the same assignment with Organization role, still no results. Finally I assigned regular role Portal Content Reviewer but not as it is common for regular roles (with UserLocalServiceUtil.setRoleUsers(roleId, userIds)), but as it would be organization/site role (UserGroupRoleServiceUtil.addUserGroupRoles(userId, userPersonalSiteGroupId, new long[] {portalContentReviewerRoleId})). To my suprise, it worked fine. Currently, private user sees only tasks that come only from his personal site!

Did I do it right? Could you give me some feedback?

Regards,
KG
Krzysztof Gołębiowski
RE: Portal Content Reviewer role within user Personal Site
May 13, 2012 8:17 AM
Answer

Krzysztof Gołębiowski

Rank: Expert

Posts: 349

Join Date: June 25, 2011

Recent Posts

Any ideas? emoticon