AKSW/Erfurt

Why re-authentication to create new model?

k00ni opened this issue · 2 comments

This issue occurs in relation to OntoWiki! I am in an action of a controller.

For instance:

class CollaboController extends OntoWiki_Controller_Component {

   /**
    * Import an ontology for given URI
    */
   public function importontologyAction () {

The plan is to create a new model via

$this->_erfurt->getStore()->getNewModel($ontologyUri, '', $newType);

But when iam doing this, it throws an exception that this operation is not allowed. For the record, i am logged in as Admin.

It runs perfectly when i authenticate myself again:

$backend = $this->_erfurt->getConfig()->store->backend;
$username = $this->_erfurt->getConfig()->store->{$backend}->username;
$password = $this->_erfurt->getConfig()->store->{$backend}->password;

$this->_erfurt->authenticate($username, $password);

After that i am able to create a new model. But was that your intention? I thought OntoWiki handle Erfurt authentication by itself.

Where is the $this->_erfurt object coming from? If you got it from the OntoWiki instance this is strange for sure. Can you provide a complete minimal (not)working example for this?

$this->_erfurt comes from the class OntoWiki_Controller_Component. Providing a complete example is not possible, because i am not quite sure how code was, but i guess it was just a getNewModell call in a function (here importontologyAction) of the controller.