Foros de discusión

Disable control panel

Elizabeth Murrieta, modificado hace 13 años.

Disable control panel

New Member Mensajes: 6 Fecha de incorporación: 1/12/10 Mensajes recientes
Hi¡¡


How I can disable the control panel, only for users with role Power
user?


thanks
thumbnail
Apoorva Prakash, modificado hace 13 años.

RE: Disable control panel

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
Hello Elizabeth,
I've not done this for Power user, but the following may work for you...
We can get user role in JSP as follows-
<%
boolean isPowerUser=false;
if (request.getUserPrincipal() != null) {
    List l = RoleServiceUtil.getUserRoles(request.getUserPrincipal().getName());
    String name;
    for (int i = 0; i < l.size(); ++i) {
        name = ((Role)l.get(i)).getName();
        if (name.equals("Power User") ) {
            isPowerUser = true;
        }
    }
}
%>


#if(isPowerUser)
    <a href="$control_panel_url">$control_panel_text</a>

Hope this will help..

Thanks, regards and happy coding... emoticon
Elizabeth Murrieta, modificado hace 13 años.

RE: Disable control panel (Respuesta)

New Member Mensajes: 6 Fecha de incorporación: 1/12/10 Mensajes recientes
thanks Apoorva,

I found another solution do not think it worked the best but is the
following:

In the file _diffs\templates\portal_normal.vm

#if(!$is_signed_in)
<a href="$sign_in_url" id="sign-in" rel="nofollow">$sign_in_text</a>
#end
#if($is_signed_in)
#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
<a href="$sign_out_url" id="sign-out" rel="nofollow">$sign_out_text</a>

#end

anyway thank you very much for your response!!!
Raghavendra Kamble, modificado hace 11 años.

Disable my account option for based on the roles

New Member Mensajes: 2 Fecha de incorporación: 28/05/12 Mensajes recientes
Hi,
i am new to this liferay, i am using liferay 6.1 with jboss.
i have a requirement from my project, if knows plz plz plz give reply.
Requirement::
1) i want hide the my account option like (password,openID,site,roles etc ) based on the roles.
for example admin role can see all option but user role can see only few option and there may another role like power user he might can see more option than normal user and less option than admin role
i had search lot in Google and i did lot way's but i am unable to hide the option.
when i search in the google , i got one soultion like below

users.form.update.main=details,password,organizations,sites,user-groups,roles,categorization
users.form.update.identification=addresses,phone-numbers,additional-email-addresses,websites,instant-messenger,social-network,sms,open-id
users.form.update.miscellaneous=announcements,display-settings,comments,custom-fields

users.form.my.account.main=details,password,organizations
users.form.my.account.identification=addresses,phone-numbers,newcategory
users.form.my.account.miscellaneous=display-settings,custom-fields

when you override these properties in portal-ext.properties. this will show the when ever admin is going edit user profile he will also get the only few option like user
please if any one done let know
thanks in advance
regards
Raghavendra k
shashidhara ml, modificado hace 11 años.

RE: Disable my account option for based on the roles

Junior Member Mensajes: 28 Fecha de incorporación: 5/10/12 Mensajes recientes
Hi refer this link
http://www.liferay.com/community/forums/-/message_boards/message/21401065

Regards
Shashi