/**
  * Applies user principals to the cache of the model.
  * Public to the world for testing
  */
 public function refreshUser()
 {
     $this->agaviUser = $this->getContext()->getUser();
     if ($this->agaviUser->isAuthenticated() === true) {
         $this->user = $this->agaviUser->getNsmUser();
         $this->principals = $this->user->getPrincipalsArray();
     }
 }
 public function initialize(AgaviContext $context, array $parameters = array())
 {
     parent::initialize($context, $parameters);
     $this->agaviUser = $this->getContext()->getUser();
     if ($this->agaviUser->isAuthenticated() === true) {
         $this->user = $this->agaviUser->getNsmUser();
         $this->setPrincipals($this->user->getPrincipalsArray());
     } else {
         throw new AppKitModelException('The model need an authenticated user');
     }
     $this->initializeXmlData();
     if (!isset($parameters['lazy'])) {
         $this->cronks = $this->getCronks(true);
     }
 }