I have this task:
realize Grails application with ExtJS.
And one part of this task:
realize authenticate function.
for example on main.gsp page we have Ext.grid.GridPanel() and button “New” and “Details” in tbar.
user must insert his login and password on login.gsp
if his data is correct his redirect to main.gsp
if user role – “admin“, user – can click “New” button and added new rows in table, if user role “simply_user” – the button – “New” – deactive and user can only look table and no more.
and now for me the biggest problem – how to implement different js code on one page, depending on whether a user opens this page.
Somebody can give me an idea how to do it?
I’m not sure I’m understanding your question correctly, but I’d say :
What I do, most of the time, is sending rights to the ExtJs Apps on the form :
I do this in PHP in the layout page loaded after login, via :
In the JS app:
I’m sure you can do it easily with groovy 😉
Of course you can also send config via an
Ext.lib.Ajax.requestif there is no page reload between sessions.