Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Julien Lafont
Restrict default permissions on a custom portlet
April 21, 2011 5:12 AM
Answer

Julien Lafont

Rank: New Member

Posts: 11

Join Date: December 4, 2009

Recent Posts

Hello,

I'm developping a custom porlet, and I would like this portlet to be only visible from the Power Users.

I can naturally configure it on every instance of the porlet, but it's not really practical (and one forgets would be dangerous).

Ideally, I would like to configure it in an xml file, but I don't know if it is possible. The portlet must be really hidden, and not render an error message (I have already set the show-portlet-access-denied and show-portlet-inactive to false).

Anyone would have a solution?
Thanx
Hitoshi Ozawa
RE: Restrict default permissions on a custom portlet
April 21, 2011 5:55 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

WEB-INF\liferay-portlet.xml

<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
Julien Lafont
RE: Restrict default permissions on a custom portlet
April 22, 2011 1:11 AM
Answer

Julien Lafont

Rank: New Member

Posts: 11

Join Date: December 4, 2009

Recent Posts

I don't think it works, with these modification, the portlet is always visible from guest or user.

I have this code in my files :

liferay-portlet.xml
1<role-mapper>
2    <role-name>power-user</role-name>
3    <role-link>Power User</role-link>
4</role-mapper>


And portlet.xml :
 1<security-role-ref>
 2    <role-name>administrator</role-name>
 3</security-role-ref>
 4<security-role-ref>
 5    <role-name>guest</role-name>
 6</security-role-ref>
 7<security-role-ref>
 8    <role-name>power-user</role-name>
 9</security-role-ref>
10<security-role-ref>
11    <role-name>user</role-name>
12</security-role-ref>
13
14---- OR only -----
15
16<security-role-ref>
17    <role-name>power-user</role-name>
18</security-role-ref>


All these solutions don't work.

I have also tried to do the restriction in a ressource-action file, unsuccessfully.
Dinesh Balaji
RE: Restrict default permissions on a custom portlet
October 24, 2011 5:12 AM
Answer

Dinesh Balaji

Rank: Junior Member

Posts: 52

Join Date: October 6, 2010

Recent Posts

Dear All,

I have developed a portlet which should be visibile to one particular role.

In Portal-ext I have added this portlet- default.user.private.layout.column-1=quickfind_WAR_QuickFindportlet and this is coming in all private pages.

To restrict the same I tried restricting by liferay-portal.xml where I can given only
<role-mapper>
<role-name>customer</role-name>
<role-link>Customer</role-link>
</role-mapper>

and I have chnaged also the portlet.xml also. But still I am not able to restrict the same. Already questions are raised on this but no reply were there - http://www.liferay.com/community/forums/-/message_boards/message/8338186

Kinldy help.

Warm Regards,
Dinesh V
Mauro Almeida
RE: Restrict default permissions on a custom portlet
May 7, 2012 9:23 AM
Answer

Mauro Almeida

Rank: Junior Member

Posts: 32

Join Date: March 15, 2012

Recent Posts

Hi Julien.

Did you manage to find the solution to this? I'm having the same problem here.

Best regards,
MJA