Forums de discussion

How to retrieve blogs entry role

venka reddy, modifié il y a 10 années.

How to retrieve blogs entry role

Regular Member Publications: 231 Date d'inscription: 23/03/11 Publications récentes
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?
thumbnail
Ahmed Hasan, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Expert Publications: 306 Date d'inscription: 13/04/07 Publications récentes
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, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Regular Member Publications: 231 Date d'inscription: 23/03/11 Publications récentes
Thanks for reply.

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

Can you elaborate it?
thumbnail
Dhrutika Vyas, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Expert Publications: 435 Date d'inscription: 09/02/09 Publications récentes
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, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Regular Member Publications: 231 Date d'inscription: 23/03/11 Publications récentes
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?
thumbnail
Dhrutika Vyas, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Expert Publications: 435 Date d'inscription: 09/02/09 Publications récentes
Good to know it helped you.

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

Regards,
Dhrutika
thumbnail
Ahmed Hasan, modifié il y a 10 années.

RE: How to retrieve blogs entry role

Expert Publications: 306 Date d'inscription: 13/04/07 Publications récentes
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