组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Darko Joseph Hojnik
setting permissions for the dockbar in Liferay 6
2010年3月21日 下午7:46
答复

Darko Joseph Hojnik

等级: Regular Member

帖子: 125

加入日期: 2009年8月3日

最近的帖子

Hi

I'm playing with the 6 preview emoticon
It is possible to set the permissions for the Dockbar in Liferay preview 6? I would like to give access only for special Groups and Administrators. So I wish that regular Users shouldn't see it. They have to manage there accounts only, not even more


best regards,
Darko
Renee Talabucon
RE: setting permissions for the dockbar in Liferay 6
2010年6月30日 上午11:45
答复

Renee Talabucon

等级: Junior Member

帖子: 31

加入日期: 2010年3月28日

最近的帖子

Hi!

This may not be exactly what you need but I've learned some ideas from this forum. What this code does is make use of the "User Groups" of Liferay to hide the dock for a certain group.

Basically, I don't want all users that I have set as members of the User Group "MyUsersGroup" to see the Dockbar, so this code checks if this user is part of it or not.

 1
 2#set ($userGroupLocalService = $serviceLocator.findService("com.liferay.portal.service.UserGroupLocalService"))
 3#set ($userGroupLst = $userGroupLocalService.getUserUserGroups($user_id))
 4#set($flag=0)
 5
 6#foreach($userGroup in $userGroupLst )
 7#if("MyUsersGroup" == $userGroup.getName().trim())
 8#set($flag=1)
 9    #if (!$show_control_panel)
10        #dockbar()       
11    #end      
12#end
13#end
14
15#if($flag==0)
16    #if ($show_control_panel)
17        #dockbar()       
18    #end
19#end   


I hope it helps. Cheers!~
Nidhi Singh
RE: setting permissions for the dockbar in Liferay 6
2010年6月30日 下午10:31
答复

Nidhi Singh

LIFERAY STAFF

等级: Regular Member

帖子: 155

加入日期: 2009年10月7日

最近的帖子

Hi,

you can use given below code to give access to admin for dockbar.

#if($permissionChecker.isCompanyAdmin($company_id))

#end

Nidhi Singh
Shafia Kiran
RE: setting permissions for the dockbar in Liferay 6
2011年2月3日 下午10:35
答复

Shafia Kiran

等级: New Member

帖子: 12

加入日期: 2010年11月2日

最近的帖子

Hello!

i want to know in which class we need to make these changes?


1
2#set ($userGroupLocalService = $serviceLocator.findService("com.liferay.portal.service.UserGroupLocalService"))
3#set ($userGroupLst = $userGroupLocalService.getUserUserGroups($user_id))
4#set($flag=0)
5
6#foreach($userGroup in $userGroupLst )
7#if("MyUsersGroup" == $userGroup.getName().trim())
8#set($flag=1)
9 #if (!$show_control_panel)
10 #dockbar()
11 #end
12#end
13#end
14
15#if($flag==0)
16 #if ($show_control_panel)
17 #dockbar()
18 #end
19#end
Minhchau Dang
RE: setting permissions for the dockbar in Liferay 6
2011年2月9日 下午5:26
答复

Minhchau Dang

LIFERAY STAFF

等级: Expert

帖子: 349

加入日期: 2007年10月22日

最近的帖子

Shafia Kiran:
i want to know in which class we need to make these changes?

You would make the changes in portal_normal.vm in your theme.
Ada Leung
RE: setting permissions for the dockbar in Liferay 6
2011年5月24日 上午6:22
答复

Ada Leung

等级: New Member

帖子: 1

加入日期: 2011年3月15日

最近的帖子

Hi,

I would like to setup something similar, but instead of checking a user group, can it be dockbar be setup as a permission to a role?
We are trying to disable dockbar for all users (even logged in users) unless they are in a Role with dockbar permission, so that when we define a Roles permission we are able to select view Dockbar? Would it be setup in the portal_normal.vm theme or class?
Achmed Tyrannus Albab
RE: setting permissions for the dockbar in Liferay 6
2012年6月20日 上午2:34
答复

Achmed Tyrannus Albab

等级: Junior Member

帖子: 66

加入日期: 2010年3月5日

最近的帖子

Ada Leung:
Hi,

I would like to setup something similar, but instead of checking a user group, can it be dockbar be setup as a permission to a role?
We are trying to disable dockbar for all users (even logged in users) unless they are in a Role with dockbar permission, so that when we define a Roles permission we are able to select view Dockbar? Would it be setup in the portal_normal.vm theme or class?


LIKES THIS! G+ PLEASE ANSWER THIS!
David H Nebinger
RE: setting permissions for the dockbar in Liferay 6
2012年6月20日 上午5:27
答复

David H Nebinger

等级: Liferay Legend

帖子: 6268

加入日期: 2006年9月1日

最近的帖子

Yes it's possible, but no it is not done in portal_normal.vm.

You can actually do this as a jsp hook on the /html/portlet/dockbar/view.jsp

Open this guy up and you'll see how the code basically launches right into the dockbar display with the <div/> tag.

Just wrap this whole guy in a check to see if the user has the particular role; if they do, let the <div /> get created. If they don't, then don't.

Note that I'd probably include the 'Administrator' role in your check for a dockbar role; you wouldn't want to lose dockbar access if you mistakenly forget to give yourself the dockbar role...