On Tuesday, May 13, 2014 3:44:33 PM UTC+5:30, Lvc@ wrote: > > Hi Guarav, > You could create a special user like "web" can execute the login() > function getting any parameters. > > On this function you can do your query and change the user based on your > requirements. >
Luca, How can we switch the user and session in JS function ? What commands to use ? Lets say I create a user "web" and client (browser) connects to DB using web user to make a call to "login" JS function. In login JS function I do the required checking and then how can I switch from "web" user to "xyz" user (along with session) in JS function. Here after all call will be done using xyz user so the session should exist for xyz user. > Lvc@ > > > > On 13 May 2014 11:31, Gaurav Dhiman <[email protected] <javascript:>>wrote: > >> Right now I am calling >> connect<https://github.com/orientechnologies/orientdb/wiki/OrientDB-REST#connect>REST >> call to login a user in system, but connect only checks the username >> against OUser.name field. If I want the username to be either email id or >> phone number (anyone of those), I think I need to write my own JS function >> (in OrientDB) and do the required checks and then set the session. >> >> Question is how to do it ? >> I will appreciate if someone can share the example code. >> >> Regards, >> Gaurav >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
