You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by robin <ro...@adm-soft.com> on 2011/02/24 03:30:12 UTC

how can i disable drag portlet window for some roles

Hi

  i want to disable drag portlet window for user roles but enable it for admin role, what can i do?

2011-02-24 



Robin 谢文彬
ADM Science & Technology Co.,Ltd.
Tel     : 86-10-8260 7022/3/6/8 ext 8812
Fax     : 86-10-8260 7022/23/26/28/ext 8880
E-Mail : robin@adm-soft.com
No.3 Dan Ling Road Hai Dian District,Beijing  100080
中国.北京市海淀区丹棱街3号中国电子大厦B座6层03-05室   100080 

Re: how can i disable drag portlet window for some roles

Posted by Woonsan Ko <wo...@yahoo.com>.
Hi Robin,

I guess you're using JetUI with Jetspeed-2.2.x.

If so, there's no built-in support to turn on/off based on user roles now.
However, there's one simple trick you can make use of:

JetUI uses YUI3 and JetUI portal script (/jetui/engine/portal.js) initializes draggable portlet fragment by looking up elements by portlet style class name, which is configured by JetuiConfiguration object like this in jetui.jsp:

var JetuiConfiguration = {
  // ...
  portletStyle: <%=pc.getString(PortalConfigurationConstants.JETUI_STYLE_PORTLET)%>",
  // ...
};

Or, if you use /portal pipeline, the JetuiConfiguration can be found in each layout decorator's header template such as header.vm.

So, if you set something non-existing for "portletStyle", then the jetui portal script (portal.js) is not able to look up any draggable elements.
For example, you can change the portletStyle based on user roles like this:

var JetuiConfiguration = {
  // ...
  portletStyle: <%=(request.isUserInRole("admin") ? pc.getString(PortalConfigurationConstants.JETUI_STYLE_PORTLET) : "nonexisting-for-no-dnd")%>",
  // ...
};


HTH,

Woonsan

P.S. It would be nicer if you can improve it to have a configuration for DnD-allowed roles generally and provide a patch through JIRA. :-)


--- On Thu, 2/24/11, robin <ro...@adm-soft.com> wrote:

> From: robin <ro...@adm-soft.com>
> Subject: how can i disable drag portlet window for some roles
> To: "jetspeed-user" <je...@portals.apache.org>
> Date: Thursday, February 24, 2011, 3:30 AM
> Hi
> 
>   i want to disable drag portlet window for user roles
> but enable it for admin role, what can i do?
> 
> 2011-02-24 
> 
> 
> 
> Robin 谢文彬
> ADM Science & Technology Co.,Ltd.
> Tel     : 86-10-8260 7022/3/6/8 ext
> 8812
> Fax     : 86-10-8260 7022/23/26/28/ext
> 8880
> E-Mail : robin@adm-soft.com
> No.3 Dan Ling Road Hai Dian District,Beijing  100080
> 中国.北京市海淀区丹棱街3号中国电子大厦B座6层03-05室   100080
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org