留言板

Disable control panel

Elizabeth Murrieta,修改在13 年前。

Disable control panel

New Member 帖子: 6 加入日期: 10-12-1 最近的帖子
Hi¡¡


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


thanks
thumbnail
Apoorva Prakash,修改在13 年前。

RE: Disable control panel

Liferay Master 帖子: 658 加入日期: 10-6-15 最近的帖子
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,修改在13 年前。

RE: Disable control panel (答复)

New Member 帖子: 6 加入日期: 10-12-1 最近的帖子
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,修改在11 年前。

Disable my account option for based on the roles

New Member 帖子: 2 加入日期: 12-5-28 最近的帖子
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,修改在11 年前。

RE: Disable my account option for based on the roles

Junior Member 帖子: 28 加入日期: 12-10-5 最近的帖子
Hi refer this link
http://www.liferay.com/community/forums/-/message_boards/message/21401065

Regards
Shashi