Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sam E
How to hide a webcontent portlet - Please help.
September 25, 2010 6:50 AM
Answer

Sam E

Rank: Liferay Master

Posts: 660

Join Date: March 2, 2009

Recent Posts

Hi,

With Liferay EE SP4, I am trying to hide a webcontent portlet base on Roles.
If the login user Role is Community member, I want to hide a webcontent portlet.
However when I created a user and assigned it to a community member, and set permission on the webcontent to Owner and Guest, uncheck the checkbox on community member -> then submit, relogin as this user, go back to the page where the webcontent portlet belong, the user still can see the webcontent porltet.

What is the proper way to hide a webcontent portlet in Liferay EE SP4?

Your helps is very much appreciated.

Thanks
Sam.
Jonas Yuan
RE: How to hide a webcontent portlet - Please help.
October 8, 2010 5:12 PM
Answer

Jonas Yuan

Rank: Liferay Master

Posts: 993

Join Date: April 26, 2007

Recent Posts

Hi Sam,

Do you want to hide the web content portlet in Control Panel?

If yes, you can get it by resetting the roles and permissions.

Hope that it helps,

Thanks

Jonas Yuan

-----------------
The Author of Liferay Books:
Liferay User Interface Development
Liferay Portal 6 Enterprise Intranets
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
Sam E
RE: How to hide a webcontent portlet - Please help.
September 25, 2010 8:50 PM
Answer

Sam E

Rank: Liferay Master

Posts: 660

Join Date: March 2, 2009

Recent Posts

Hi Jonas,

Appreciate for your reply.
I have had a look at the Permission by going through control panel-> Web Content->click on the Action button for the webcontent -> select Permission. In the Permission page of this web content, I remove the view for community member role and allow Guest and Owner view for this web content. But when I login as a community member (role) I still able to see the web content portlet on the page. If I remove the view for Guest role, login a user without any role defined, the user still can't see the web content portlet.

I have reviewed the Roles setup for this user, it does not contain any Role there - Not a User role nor a Power User role.

I am wondering if Liferay has implicitly assigned a Default role (Guest) to this user.
And why a user wtihout any role still can see a web content portlet that has configured to be only seen by Guest and Owner?

Thanks
Sam
Ray Augé
RE: How to hide a webcontent portlet - Please help.
October 2, 2010 10:24 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

By default we don't enable web content view permission checking to offer a slight savings on performance.

To enable it set this property to true:

1    #
2    # Set this to true to check that a user has the VIEW permission on a
3    # Journal article when its content is rendered.
4    #
5    journal.article.view.permission.check.enabled=false


in portal-ext.properties
Sam E
RE: How to hide a webcontent portlet - Please help.
October 9, 2010 6:21 AM
Answer

Sam E

Rank: Liferay Master

Posts: 660

Join Date: March 2, 2009

Recent Posts

Hello Ray,

Thank you for the suggestion.
I have added the line in portal-ext.properties file.
Restarted liferay (shutdown & start.sh), and login as a particular user without the owner and Guest Roles, but the web content still shown on the web page.

Here is the line I have added in portal-ext.properties file:

1
2journal.article.view.permission.check.enabled=true


The permission of the web content has only Guest and Owner in-placed.
You can refer to the attachment that come with this post for more information.

Very appreciate for the help again.

Thanks
Sam
Attachments: images.doc (105.5k)
Hugh Martin
RE: How to hide a webcontent portlet - Please help.
October 9, 2010 9:40 PM
Answer

Hugh Martin

Rank: Junior Member

Posts: 75

Join Date: June 15, 2010

Recent Posts

I am having the exact same problem with Liferay 6 EE Trial. I've also added journal.article.view.permission.check.enabled=true to my portal-ext.properties, but the web content portlet still appears. Any recommendations out there?
Ed Holderman
RE: How to hide a webcontent portlet - Please help.
January 27, 2011 10:14 AM
Answer

Ed Holderman

Rank: Junior Member

Posts: 25

Join Date: July 15, 2010

Recent Posts

I've not seen a solution to this anywhere. In Liferay 5.2.3 I want to create a piece of web content for Guest with a link to sign in through CAS. After the person logs in and becomes a "User", I don't want the portlet to display anymore (not just the content, the whole portlet). I used a Web Content portlet to show the content from the CMS on a public page. On the portlet I assigned View permissions to Guest and our Administrator role and removed all permissions for "User". The portlet displays appropriately for unauthenticated users but still shows for authenticated users having no roles assigned. This is wrong, User should not inherit the permissions of Guest. Why is it happening?

Thanks,
Ed
Melvin Rodriguez Rojas
RE: How to hide a webcontent portlet - Please help.
April 4, 2011 8:35 AM
Answer

Melvin Rodriguez Rojas

Rank: Junior Member

Posts: 50

Join Date: February 4, 2011

Recent Posts

There are a way to hide a portlet based in java code...???
for example when I do click on a button set visible the portlet that was hidden.
Thanks
Davide N. P. Rossi
RE: How to hide a webcontent portlet - Please help.
February 15, 2012 7:25 AM
Answer

Davide N. P. Rossi

Rank: Junior Member

Posts: 55

Join Date: July 3, 2010

Recent Posts

Ed Holderman:
I've not seen a solution to this anywhere. In Liferay 5.2.3 I want to create a piece of web content for Guest with a link to sign in through CAS. After the person logs in and becomes a "User", I don't want the portlet to display anymore (not just the content, the whole portlet). I used a Web Content portlet to show the content from the CMS on a public page. On the portlet I assigned View permissions to Guest and our Administrator role and removed all permissions for "User". The portlet displays appropriately for unauthenticated users but still shows for authenticated users having no roles assigned. This is wrong, User should not inherit the permissions of Guest. Why is it happening?

Thanks,
Ed


Wow this is a pretty old post, but it seems nobody has had an answer to this question... 6.1.0 GA1 and today's github version still reflect this issue.
Can someone help???

Thanks...
Johann Kneringer
RE: How to hide a webcontent portlet - Please help.
December 19, 2012 12:54 AM
Answer

Johann Kneringer

Rank: Junior Member

Posts: 40

Join Date: November 10, 2011

Recent Posts

i need help on this issue too...

I want to make a web content display only available to guests, not to site member within a site...