Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sunil Rai
Liferay 6.1.1 CE GA2 disable Add Application and Manage Page for user
February 11, 2013 5:33 AM
Answer

Sunil Rai

Rank: Junior Member

Posts: 57

Join Date: January 31, 2012

Recent Posts

I want to disable add application and manage page for normal user. It should be only available for administrator . I am using property
1layout.user.public.layouts.modifiable=false
in portal-ext.properties, but still it is showing modify options on user public and private pages.

Reference links:

https://www.liferay.com/community/forums/-/message_boards/message/1761995

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen06-user-personal-sites-0

I tried with settings mentioned in the above links but I am not able to implement it. Other options like hide public page, private page , control panel etc is working fine for me. I am deploying my portal on Ubuntu Server 12.10.
David H Nebinger
RE: Liferay 6.1.1 CE GA2 disable Add Application and Manage Page for user
February 11, 2013 6:38 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11492

Join Date: September 1, 2006

Recent Posts

You can either do this in your theme (edit portal_normal.vm to put conditional logic around the #dockbar line) or your can do a JSP hook on html/portlet/dockbar.view.jsp to conditionally include the dockbar div.

We use a JSP hook. In our hook we check the roles that a user has, and only include the dockbar div if they are an administrator.

We elected to use the JSP hook because we didn't want to have to remember to duplicate the logic in all of the themes...

P.s the property just defines whether the user can add/remove portlets on their public pages, it has nothing to do w/ whether they can modify options on the pages or not.
Jitendra Rajput
RE: Liferay 6.1.1 CE GA2 disable Add Application and Manage Page for user
February 11, 2013 8:20 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Modify view.jsp of dockbar portlet in hook. You can create custom role and define required permission on that role.
Check for that role in hook.

<c:if test="<%= (!group.isControlPanel() && (!group.hasStagingGroup() || group.isStagingGroup()) && (GroupPermissionUtil.contains(permissionChecker, group.getGroupId(), ActionKeys.ADD_LAYOUT) || hasLayoutUpdatePermission || (layoutTypePortlet.isCustomizable() && layoutTypePortlet.isCustomizedView() && hasLayoutCustomizePermission))) && hasApplicationRole %>">


See at the end code checking for if use has hasApplicationRole role or not. If user dont have that role then add application menu wont be visible to that user.

You need to define below permission to make add application menu visible to user who has this "ApplicationRole".


General -->Sites -- > Page -- > Customize
General -->Sites -- > Page -- > Update
General -->Sites -- > Site -- > Add Page
Sunil Rai
RE: Liferay 6.1.1 CE GA2 disable Add Application and Manage Page for user
February 28, 2013 1:24 AM
Answer

Sunil Rai

Rank: Junior Member

Posts: 57

Join Date: January 31, 2012

Recent Posts

I think creating a hook will be good option. I will check and post the update.

Thanks