I'm thinking (in theory just now), how I can reconcile ajax requests
and agavi credentials system.

Examply situation:
1. We have action which return in JSON array with some data (it can be
categories, users or something else). But that informations are only
for users with "user" role. Call this action "A action".
2. We have second action where we have JavaScript which execute
request to A action, call it "B action".

And now user who doesn't have right to access to action A are execute
request to it from action B.
And how we can send information to ajax "Sorry but you don't have a
right for see this action"?
Because now agavi will be redirect user to login action - doesn't it?

I think the beast idea can be check rights in action and then choose view.
If user doesn't have rights then we return error "RightsError" which
has "RightsError" response.
And then in ajax we check if (response == "RightsError").
But this idea has one deficiency we can't use getCredentials method.

Maybe you have some ideas how to write it?

--
Daniel Ancuta.

P.S.
Sorry for my english. I have hope you understand what I wrote :)

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to