Fórumok
RE: Dockbar only for Administration
Gerardo Roger, módosítva 11 év-val korábban
Dockbar only for Administration
New Member Bejegyzések: 16 Csatlakozás dátuma: 2012.03.28. Legújabb bejegyzések
Hi, I was looking for ways that the dockbar only appear for users with role of administration or other option is this possible? I guess I have to set something in the portal_normal.vm in the following lines:
#if ($is_signed_in)
#dockbar()
#end
#if ($is_signed_in)
#dockbar()
#end
Jitendra Rajput, módosítva 11 év-val korábban
RE: Dockbar only for Administration
Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
Try by using Liferay service classes in velocity file .
Something like this . Not tested but it will help you to achieve your requirement.
In above code user id you can easily get from request .
And to get role id again you need to access role services.
Something like this . Not tested but it will help you to achieve your requirement.
#set ($roleLocalService= $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set ($isAdmin = $roleLocalService.hasUserRole($userId, $roleId))
In above code user id you can easily get from request .
$request.get("theme-display").get("user-id"))
And to get role id again you need to access role services.
Mikel Goikoetxea, módosítva 11 év-val korábban
RE: Dockbar only for Administration
Junior Member Bejegyzések: 54 Csatlakozás dátuma: 2010.03.16. Legújabb bejegyzések
Hi Gerardo,
Try with the $permissionChecker. For example:
Un saludo,
Mikel Goikoetxea Bilbao (@mgoibil)
B2B 2000
Try with the $permissionChecker. For example:
#if (($permissionChecker.isOmniadmin())||$permissionChecker.isCompanyAdmin($themeDisplay.getCompanyId())|| $permissionChecker.isCommunityAdmin($themeDisplay.getScopeGroupId()))
#dockbar()
#end
Un saludo,
Mikel Goikoetxea Bilbao (@mgoibil)
B2B 2000
Gerardo Roger, módosítva 11 év-val korábban
RE: Dockbar only for Administration
New Member Bejegyzések: 16 Csatlakozás dátuma: 2012.03.28. Legújabb bejegyzések
Thank you for your answers, I have solved my problem with the option you suggested Mikel.
Muchas gracias por todo Mikel, un saludo!
Muchas gracias por todo Mikel, un saludo!
Puneet Upadhyay, módosítva 11 év-val korábban
RE: Dockbar only for Administration
Regular Member Bejegyzések: 234 Csatlakozás dátuma: 2011.10.22. Legújabb bejegyzések
Hi Roger,
Its really nice one. Thanks Mike also.
Its really nice one. Thanks Mike also.
Ravi Kumar Gupta, módosítva 11 év-val korábban