Combination View Flat View Tree View
Threads [ Previous | Next ]
Joshua Asbury
Hiding The Dock
October 3, 2008 1:44 PM
Answer

Joshua Asbury

LIFERAY STAFF

Rank: Expert

Posts: 497

Join Date: September 8, 2006

Recent Posts

Hi all -

I would like to hide the dock from users who are not signed in, but I am unsure how to accomplish this. I have tried putting something basic into portal_normal.vm like
1#if ($show_my_account)
2                #parse ("$full_templates_path/dock.vm")
3            #end

but it is still showing up. Any ideas on how best to accomplish this?

Thanks!
Tobias Amon
RE: Hiding The Dock
October 6, 2008 1:09 AM
Answer

Tobias Amon

Rank: Liferay Master

Posts: 549

Join Date: August 8, 2007

Recent Posts

Hi,

maybe you can try this:

1#if ($is_signed_in)


kind regards
Tobias
Rob Sonke
RE: Hiding The Dock
October 6, 2008 1:50 AM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

Yes that will work.

We're looking for a more complicated, role based solution. Like only show the dock to managers and admins. Does anybody know a solition for that?
Ray Augé
Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 6, 2008 5:49 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

On Mon, 2008-10-06 at 08:50 +0000, Rob Sonke at Liferay's Community
Forums wrote:

> Yes that will work.
>
> We're looking for a more complicated, role based solution. Like only
> show the dock to managers and admins. Does anybody know a solition for
> that?


What is your definition of admin? Is it someone who can edit the current
Layout... is it anyone belonging to a give User Group, has a given Role,
etc??? What's the common thread?
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 7, 2008 1:22 PM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

It's all role based, some roles should see the dock and others shouldn't. It wouldn't be a problem to hardcode the role names in the theme templates but I don't think it's possible to get the roles of a certain user in Velocity.
Ray Augé
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 7, 2008 1:45 PM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1171

Join Date: February 7, 2005

Recent Posts

On Tue, 2008-10-07 at 20:22 +0000, Rob Sonke at Liferay's Community
Forums wrote:

> It's all role based, some roles should see the dock and others
> shouldn't. It wouldn't be a problem to hardcode the role names in the
> theme templates but I don't think it's possible to get the roles of a
> certain user in Velocity.


Uhmm, shot in the dark, but why don't you simply create a new
resource-action associated with Layout called VIEW_DOCK. Then simply
check that permission which you can then assign to any Roles you need.

$layoutPermission.contains($permissionChecker,
$getterUtil.getLong($plid), "VIEW_DOCK")


It's a one line config change.

copy portal-impl.jar!/resource-actions/communities.xml to
ROOT/WEB-INF/classes/resource-actions/communities.xml

add line at line ~28 add:

<action-key>VIEW</action-key>
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 7, 2008 11:41 PM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

Cool Ray, I'm going to try that in the near future.

Thanks.
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 9, 2008 1:53 PM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

I have overwritten the communities.xml through the ext environment and it worked like a charm! Thanks for the tip.
vijay s patil
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 20, 2009 3:25 AM
Answer

vijay s patil

Rank: New Member

Posts: 4

Join Date: April 20, 2009

Recent Posts

hi rob..
can you explain step by step to do that.. i am new guy to liferay. actually i want to do this..

On the Top navigation (Dock) Manapages and Layouts are visible only for particular roles ( Eg: admin or editor etc)
role may change any point of time it shuld be configurable
please reply me soon..
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 20, 2009 10:42 AM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

What have you tried so far and which part you don't understand? It will be quite a lot of explanation if I have to tell you everyting in detail.
vijay s patil
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 20, 2009 10:32 PM
Answer

vijay s patil

Rank: New Member

Posts: 4

Join Date: April 20, 2009

Recent Posts

hi Rob.. Thanks for reply
I am using liferay-5.2.0, i am new to liferay , my aim is to show the dock to the particular user (like admin ,editor etc), admin can change the role to view the dock for different user. as Ray said... simply create a new
resource-action associated with Layout called VIEW_DOCK. Then simply
check that permission which you can then assign to any Roles you need.

Where i have to create the VIEW_DOCK and what code i have to write in that.
then Ray given below code where i have to put this code

$layoutPermission.contains($permissionChecker,
$getterUtil.getLong($plid), "VIEW_DOCK")

and he mention that
copy portal-impl.jar!/resource-actions/communities.xml to
ROOT/WEB-INF/classes/resource-actions/communities.xml

add line at line ~28 add:

<action-key>VIEW</action-key>

i look at that communities.xml file and in 28 line it has that code as above mention..

can you please tell me the all things step-by-step to achieve this ..
you only guy can help me to do this

Thank You Very much Rob
Vijay Patil
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 21, 2009 11:55 AM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

Well, you found the right file already, just add the following:

<action-key>VIEW_DOCK</action-key>

below the

<action-key>VIEW</action-key>

Next step is to login in your portal and add this action to your role (admin, editor etc).

Last step is to add some checks to your (custom) theme in the portal_normal.vm. Somewhere in that file you include dock.vm:

#parse ("$full_templates_path/dock.vm")

Now just add the check around that statement like this:

#if($layoutPermission.contains($permissionChecker, $getterUtil.getLong($plid), "VIEW_DOCK"))
#parse ("$full_templates_path/dock.vm")
#end

That's all!
Jeffrey Paul Handa
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 21, 2009 5:50 PM
Answer

Jeffrey Paul Handa

LIFERAY STAFF

Rank: Expert

Posts: 467

Join Date: December 1, 2008

Recent Posts

Hi Vijay,

I see Rob has already provided a very detailed response. I figured this was a very useful topic so I had put together a wiki article.

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Using+Custom+Permissions+in++Theme
vijay s patil
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
April 21, 2009 8:05 PM
Answer

vijay s patil

Rank: New Member

Posts: 4

Join Date: April 20, 2009

Recent Posts

thank you very much Rob and Jeffrey.. finally i got the result.. i think this forum thread will help very much to new guys
Peter MacKinnon
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
February 4, 2010 11:33 AM
Answer

Peter MacKinnon

Rank: New Member

Posts: 9

Join Date: February 4, 2010

Recent Posts

I am trying to do the same with my portal and I have implemented the suggested fix and it does work, however, the dock is still available to users on their My Profile page. I want to turn the dock off here, as well, can someone help me with that?

Thanks!
Mickey Fox
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
February 25, 2010 11:48 AM
Answer

Mickey Fox

Rank: Junior Member

Posts: 60

Join Date: July 15, 2009

Recent Posts

Thanks for creating the wiki Jeffrey. Might I suggest that you add also (I post this here for those who run across the article) a caveat for those newer to liferay - REMEMBER: for those who are running only one theme - ensure that you have created a sign-in page or link *before* you implement the hide dock - otherwise you will need to manually unload the theme in order to regain access.

I speak from much experience here - and I even know (or am supposed to) what I am doing.emoticon
Rob Sonke
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
February 25, 2010 11:52 AM
Answer

Rob Sonke

Rank: Expert

Posts: 275

Join Date: August 26, 2007

Recent Posts

/c/portal/login always works
Mickey Fox
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
February 26, 2010 12:37 PM
Answer

Mickey Fox

Rank: Junior Member

Posts: 60

Join Date: July 15, 2009

Recent Posts

HA! Any answer that is too easy gets demerits!

Thanks, that is good info.
Jin S Lee
RE: Re: [Liferay Forums][4.3.x Themes] RE: Hiding The Dock
October 14, 2008 12:10 PM
Answer

Jin S Lee

Rank: New Member

Posts: 10

Join Date: April 16, 2008

Recent Posts

Ray Augé:
On Tue, 2008-10-07 at 20:22 +0000, Rob Sonke at Liferay's Community
Forums wrote:

> It's all role based, some roles should see the dock and others
> shouldn't. It wouldn't be a problem to hardcode the role names in the
> theme templates but I don't think it's possible to get the roles of a
> certain user in Velocity.


Uhmm, shot in the dark, but why don't you simply create a new
resource-action associated with Layout called VIEW_DOCK. Then simply
check that permission which you can then assign to any Roles you need.

$layoutPermission.contains($permissionChecker,
$getterUtil.getLong($plid), "VIEW_DOCK")


It's a one line config change.

copy portal-impl.jar!/resource-actions/communities.xml to
ROOT/WEB-INF/classes/resource-actions/communities.xml

add line at line ~28 add:

<action-key>VIEW</action-key>


Hi there - found this thread via google. Thanks for the tip.

Do you know where I can find out more on how to create a resource-action within Layout? I am a little confused on how to do that and then "assign to any roles" as you noted.

Thank you very much!
Jin Lee