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 cnguyen8 <cn...@hotmail.com> on 2012/03/05 00:17:02 UTC

Jetspeed 2 - block user from closing porlet after login.

I want to set up 2 type of users in jetspeed 2.2.2
One is admin and one is user.
the admin can do everything while the user can only view the page.  They
can't close the portlet either.
Because every time user close the porlet, i have to make the user become
admin again to add the porlet.  
Has anyone successfully did this?

Summary.

Basically, i want the user must login but have the viewing option as if they
were never login.
If you open up jetspeed before login, you can only see minimize and
maximize, no "closing" option.
Once the user login, they have same view but with closing button.  I want to
block this "closing" button from the users.  

Please help, thanks in advance.
-- 
View this message in context: http://old.nabble.com/Jetspeed-2---block-user-from-closing-porlet-after-login.-tp33440487p33440487.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


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


Re: Jetspeed 2 - block user from closing porlet after login.

Posted by cnguyen8 <cn...@hotmail.com>.
Awe some - work perfect.
For future reference on any one want to do this:

Here the of the code:

if (request.isUserInRole("admin") && request.getUserPrincipal() != null &&
fragment.getDecoration().getActions().size() > 0)

--------



Woonsan Ko wrote:
> 
> Hi,
> 
> Unfortunately, the close button in JetUI hasn't been integrated with the
> standard actions yet. So, it is not controlled by the security
> configuration.
> However, you may customize the
> /jetspeed/WEB-INF/jetui/yui/jetui-portlet.jsp in the following fragment
> (L#75~):
> 
> <%                       } // for loop               
> // FIXME: integrate close into standard actions, use security constraints
> on close action
> if (request.getUserPrincipal() != null &&
> fragment.getDecoration().getActions().size() > 0)
> {
> %>
>                  ' title="close" class="portlet-action-close">
> "<%=request.getContextPath()% /decorations/images/close.gif" alt="Close"
> border="0" />
> 
> For example, you may add one more condition like
> 'request.isUserInRole("admin")' above.
> 
> Kind regards,
> 
> Woonsan
> 
> 
> 
> 
>>________________________________
>> From: cnguyen8 <cn...@hotmail.com>
>>To: jetspeed-user@portals.apache.org 
>>Sent: Sunday, March 4, 2012 6:17 PM
>>Subject: Jetspeed 2 - block user from closing porlet after login.
>> 
>>
>>I want to set up 2 type of users in jetspeed 2.2.2
>>One is admin and one is user.
>>the admin can do everything while the user can only view the page.  They
>>can't close the portlet either.
>>Because every time user close the porlet, i have to make the user become
>>admin again to add the porlet.  
>>Has anyone successfully did this?
>>
>>Summary.
>>
>>Basically, i want the user must login but have the viewing option as if
they
>>were never login.
>>If you open up jetspeed before login, you can only see minimize and
>>maximize, no "closing" option.
>>Once the user login, they have same view but with closing button.  I want
to
>>block this "closing" button from the users.  
>>
>>Please help, thanks in advance.
>>-- 
>>View this message in context:
http://old.nabble.com/Jetspeed-2---block-user-from-closing-porlet-after-login.-tp33440487p33440487.html
>>Sent from the Jetspeed - User mailing list archive at Nabble.com.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>>
> 

-- 
View this message in context: http://old.nabble.com/Jetspeed-2---block-user-from-closing-porlet-after-login.-tp33440487p33453168.html
Sent from the Jetspeed - User mailing list archive at Nabble.com.


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


Re: Jetspeed 2 - block user from closing porlet after login.

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

Unfortunately, the close button in JetUI hasn't been integrated with the standard actions yet. So, it is not controlled by the security configuration.
However, you may customize the /jetspeed/WEB-INF/jetui/yui/jetui-portlet.jsp in the following fragment (L#75~):

<%                       } // for loop               
// FIXME: integrate close into standard actions, use security constraints on close action
if (request.getUserPrincipal() != null && fragment.getDecoration().getActions().size() > 0)
{
%>
                 <span style='cursor: pointer; z-index: 1000;' id='jetspeed-close-<%=fragment.getId()%>' title="close" class="portlet-action-close"><img src="<%=request.getContextPath()%>/decorations/images/close.gif" alt="Close" border="0" /></span>

For example, you may add one more condition like 'request.isUserInRole("admin")' above.

Kind regards,

Woonsan




>________________________________
> From: cnguyen8 <cn...@hotmail.com>
>To: jetspeed-user@portals.apache.org 
>Sent: Sunday, March 4, 2012 6:17 PM
>Subject: Jetspeed 2 - block user from closing porlet after login.
> 
>
>I want to set up 2 type of users in jetspeed 2.2.2
>One is admin and one is user.
>the admin can do everything while the user can only view the page.  They
>can't close the portlet either.
>Because every time user close the porlet, i have to make the user become
>admin again to add the porlet.  
>Has anyone successfully did this?
>
>Summary.
>
>Basically, i want the user must login but have the viewing option as if they
>were never login.
>If you open up jetspeed before login, you can only see minimize and
>maximize, no "closing" option.
>Once the user login, they have same view but with closing button.  I want to
>block this "closing" button from the users.  
>
>Please help, thanks in advance.
>-- 
>View this message in context: http://old.nabble.com/Jetspeed-2---block-user-from-closing-porlet-after-login.-tp33440487p33440487.html
>Sent from the Jetspeed - User mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
>