[Midas] authenticated access

Mona Wong mona at sdsc.edu
Mon Jun 25 15:20:00 EDT 2012


	Great, thanks Zach!  I will give that a try (:

cheers,
Mona


On Jun 25, 2012, at 12:15 PM, Zach Mullen wrote:

> Sorry, I didn't realize you were talking about from within your module.  If you have the user DAO, and want to know that user's default API key, you would do the following:
> 
> $user = $this->userSession->Dao;  // get the DAO from the current session user
> $modelLoader = new MIDAS_ModelLoader(); //instantiate the model loader object
> $userApiModel = $modelLoader->loadModel('Userapi', 'api'); //load the model for the user api keys
> $defaultApiKey = $userApiModel->getByAppAndUser('Default', $user); //retrieve the default api key for the current user
> 
> Hope this helps,
> 
> -Zach
> 

*********************************************
    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    "Forgive everyone everything."
				-- Regina Brett
*********************************************







More information about the Midas mailing list