Fórum
Checking permissions in Javascript
Lior Hadaya, modificado 11 Anos atrás.
Checking permissions in Javascript
Regular Member Postagens: 138 Data de Entrada: 24/01/12 Postagens Recentes
Hi,
I'm using Liferay EE 6.1.20.
I know it's easy to check if the logged in user has edit permission on a page in Java code, like this:
My question is - can I do the same using Liferay's Javascript API?
I found this method: Liferay.Service.Portal.Permission.checkPermission(params, callback)
inside the Liferay Javascript object, but haven't been able to figure out how to use it.
Any help would be greatly appreciated!
Thanks,
Lior
I'm using Liferay EE 6.1.20.
I know it's easy to check if the logged in user has edit permission on a page in Java code, like this:
boolean can_update = LayoutPermissionUtil.contains(themeDisplay.getPermissionChecker(), layout, ActionKeys.UPDATE);
My question is - can I do the same using Liferay's Javascript API?
I found this method: Liferay.Service.Portal.Permission.checkPermission(params, callback)
inside the Liferay Javascript object, but haven't been able to figure out how to use it.
Any help would be greatly appreciated!
Thanks,
Lior