Below code can be used to check logged in user is Admininstrator then display Dockbar:#if ($permissionChecker.isOmniadmin())#dockbar()#end
Below code snippet is used to show/hide dockbar based on custom Role. If logged in user has custom Role assigned, then dockbar shall be visible to him. It shall be hidden for rest of users.
#if ( $is_signed_in ) #set ($roleService = $serviceLocator.findService("com.liferay.portal.service.RoleService")) #set ($listOfUserRoles = $roleService.getUserRoles( $user_id )) #foreach( $userRole in $listOfUserRoles) #if ($userRole.getName() == "Custom-Role") #dockbar() #end #end#end
Hi , Please help me for the above thing for custome roles
ReplyDeleteI created new regular role with PSS and assigned one user to that role and above code was copied into portal_normal.vm file in custome Theme. Please find the below code.
#if ( $is_signed_in )
#set ($roleService = $serviceLocator.findService("com.liferay.portal.service.RoleService"))
#set ($listOfUserRoles = $roleService.getUserRoles( $user_id ))
#foreach( $userRole in $listOfUserRoles)
#if ($userRole.getName() == "PSS")
#dockbar()
#end
#end
#end
But the below code is not working . Please kindly help me for that . But here just I created regular role .
Hi , Please help me for the above thing for custome roles
ReplyDeleteI created new regular role with PSS and assigned one user to that role and above code was copied into portal_normal.vm file in custome Theme. Please find the below code.
#if ( $is_signed_in )
#set ($roleService = $serviceLocator.findService("com.liferay.portal.service.RoleService"))
#set ($listOfUserRoles = $roleService.getUserRoles( $user_id ))
#foreach( $userRole in $listOfUserRoles)
#if ($userRole.getName() == "PSS")
#dockbar()
#end
#end
#end
But the below code is not working . Please kindly help me for that . But here just I created regular role .
Please reply any one for the above issue
ReplyDelete