留言板

setting permissions for the dockbar in Liferay 6

thumbnail
Darko Joseph Hojnik,修改在14 年前。

setting permissions for the dockbar in Liferay 6

Regular Member 帖子: 125 加入日期: 09-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
thumbnail
Renee Talabucon,修改在13 年前。

RE: setting permissions for the dockbar in Liferay 6

Junior Member 帖子: 31 加入日期: 10-3-29 最近的帖子
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.


#set ($userGroupLocalService = $serviceLocator.findService("com.liferay.portal.service.UserGroupLocalService"))
#set ($userGroupLst = $userGroupLocalService.getUserUserGroups($user_id))
#set($flag=0)

#foreach($userGroup in $userGroupLst )
#if("MyUsersGroup" == $userGroup.getName().trim())
#set($flag=1)
    #if (!$show_control_panel)
		#dockbar()		
    #end       
#end
#end

#if($flag==0)
	#if ($show_control_panel)
		#dockbar()		
	#end
#end   


I hope it helps. Cheers!~
Shafia Kiran,修改在13 年前。

RE: setting permissions for the dockbar in Liferay 6

New Member 帖子: 12 加入日期: 10-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
thumbnail
Minhchau Dang,修改在13 年前。

RE: setting permissions for the dockbar in Liferay 6

Liferay Master 帖子: 598 加入日期: 07-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,修改在12 年前。

RE: setting permissions for the dockbar in Liferay 6

New Member 发布: 1 加入日期: 11-3-16 最近的帖子
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?
thumbnail
Achmed Tyrannus Albab,修改在11 年前。

RE: setting permissions for the dockbar in Liferay 6

Regular Member 帖子: 158 加入日期: 10-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!
thumbnail
David H Nebinger,修改在11 年前。

RE: setting permissions for the dockbar in Liferay 6

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
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...
thumbnail
Nidhi Singh,修改在13 年前。

RE: setting permissions for the dockbar in Liferay 6

Regular Member 帖子: 155 加入日期: 09-10-7 最近的帖子
Hi,

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

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

#end

Nidhi Singh