Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
venka reddy
How to retrieve blogs entry role
August 29, 2013 11:18 AM
Answer

venka reddy

Rank: Regular Member

Posts: 230

Join Date: March 23, 2011

Recent Posts

Hi,

How Can we retrieve roles for the blog entries i.e I want to retrieve the roles, who have view permission for the blog post.

can suggestions?
Ahmed Hasan
RE: How to retrieve blogs entry role
August 29, 2013 11:19 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 303

Join Date: April 13, 2007

Recent Posts

Hi Venka,

You can retrieve this in information from the ResourcePermission table my making use of the appropriate API's that Liferay provides.

Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
venka reddy
RE: How to retrieve blogs entry role
August 29, 2013 12:18 PM
Answer

venka reddy

Rank: Regular Member

Posts: 230

Join Date: March 23, 2011

Recent Posts

Thanks for reply.

I have gone through the ResourcePermissionLocalserviceImpl, I didn't get the method that is useful.

Can you elaborate it?
Dhrutika Vyas
RE: How to retrieve blogs entry role
August 30, 2013 6:51 AM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Hi Venka,

May be you can check using PermissionChecker.hasPermission(long groupId, String name, long primKey, String actionId);

If it returns true that get Role of the user.

Regards,
Dhrutika
venka reddy
RE: How to retrieve blogs entry role
August 30, 2013 9:49 AM
Answer

venka reddy

Rank: Regular Member

Posts: 230

Join Date: March 23, 2011

Recent Posts

Hi Dhrutika,

Thanks for reply, very helpful.

Also I need to get the roles of other users who have view permission the blog post, As you said it will reterive the current user roles.

Any Suggestions?
Dhrutika Vyas
RE: How to retrieve blogs entry role
September 2, 2013 11:15 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 435

Join Date: February 9, 2009

Recent Posts

Good to know it helped you.

Same method should help you. If that method returns true get that user's role.

Regards,
Dhrutika
Ahmed Hasan
RE: How to retrieve blogs entry role
September 3, 2013 12:41 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 303

Join Date: April 13, 2007

Recent Posts

Hi Venka,

I have the solution with me. But i am not finding time to get the complete code and send to you. If you are in bangalore, we can probably spend some time and i can sit with you to do this and give the working code.

Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook