if (!isset($schema)) { if ($schema_property) { sfPropelParanoidBehavior::disable(); $schema = $schema_property->getSchema(); } } $tab = false; break; case 'schemauser': $showBc = true; $showSchemaBc = true; $showSchemaUserBc = true; if (!isset($schema_has_user)) { $id = 'show' == $action ? $sf_params->get('id') : $paramId; if ($id) { $schema_has_user = SchemaHasUserPeer::retrieveByPK($id); } } $objectId = $schema_has_user->getID(); if (!isset($schema)) { $schema = $schema_has_user->getSchema(); } $tab = false; break; case 'export': $showBc = true; $showSchemaBc = true; $tab = true; $title = __('Export'); break; case 'import':
public function getSchemaCredentials($schemaId = false) { //$schemaId = sfContext::getInstance()->getRequest()->getParameter('id'); if ($this->isAuthenticated()) { if (!$this->hasCredential(array(0 => 'hasAgents'))) { $this->setHasAgents(); } if ($schemaId) { //make sure we've revoked the credentials -- we revoke, then set them every time the schema is accessed $this->removeCredential('schemacontact'); $this->removeCredential('schemaregistrar'); $this->removeCredential('schemamaintainer'); $this->removeCredential('schemaadmin'); /* @var SchemaHasUserPeer */ $schemaContact = SchemaHasUserPeer::retrieveByPK($schemaId, $this->getSubscriberId()); if (isset($schemaContact)) { $this->addCredential('schemacontact'); if ($schemaContact->getIsRegistrarFor()) { $this->addCredential('schemaregistrar'); } if ($schemaContact->getIsMaintainerFor()) { $this->addCredential('schemamaintainer'); } if ($schemaContact->getIsAdminFor()) { $this->addCredential('schemaadmin'); } } } elseif ('create' == sfContext::getInstance()->getRequest()->getParameter('action')) { $this->addCredential('schemacontact'); $this->addCredential('schemaregistrar'); $this->addCredential('schemaadmin'); } } return; }