Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: LIFERAY JAVASCRIPT APIS
Hi,
From Google chrome console, you can access Liferay JavaScript object (screenshots below)
From here
it says, "The Liferay
JavaScript object exposes
methods, objects, and properties that you can use to access Liferay
Portal-specific information"
I was wondering, if we could disable it or change it from public access. If yes, how to disable this and if we disable it, will it break any functionality?
Hope someone could shed some light.
Regards,
Arun
You should not change the Liferay javascript unless you really, really, really know what you're doing.
And if you really, really, really think you know what you are doing, scrap that thought and go back to not changing the Liferay javascript.
Hi David,
I was debugging something else and found this by accident and I’m not planning to change anything from that JavaScript. I was just wondering if there is any way to hide it from global access. Something like, you can make json web services discoverable on api page using a property
jsonws.web.service.api.discoverable=true
and set this to false to hide it from api page.
Regards,
Arun
getUserId() does not invoke the back end. It is a javascript-only object that has been populated during page rendering. If that's the only method you're concerned about "hiding", there is no reason to pursue it because it is not able to be hidden.
Discoverability just hides it from the /api/jsonws listing, but it does not make the method protected or anything. Knowing what I know about Liferay, I can invoke services against your instance whether /api/jsonws is working or not.
David H Nebinger:getUserId() does not invoke the back end. It is a javascript-only object that has been populated during page rendering. If that's the only method you're concerned about "hiding", there is no reason to pursue it because it is not able
No, thats was just an example.
Discoverability just hides it from the /api/jsonws listing, but it does not make the method protected or anything. Knowing what I know about Liferay, I can invoke services against your instance whether /api/jsonws is working or not.
Yes, that was the basic idea for this too, just hide.
Thanks and anyways, the answer is no then.
Regards,
Arun
Powered by Liferay™