[TYPO3-50-general] Security: Extend the Account Model

Julian Kleinhans typo3 at kj187.de
Mon Nov 22 21:42:40 CET 2010

Hey guys,

i will extend the F3\FLOW3\Security\Account Model with more informations 
like Realname, email, Paypal Account and so on..

My current solution is this:

i create a new Model in my Package


This Model extends the basic model F3\FLOW3\Security\Account
Here i defined all the new information i need with his getter and setter.

The next step is to create a new AccountRepository thats extends the 
repository \F3\FLOW3\Security\AccountRepository

The constructor was changend to

public function __construct() {
	$this->addedObjects = new \SplObjectStorage();
	$this->removedObjects = new \SplObjectStorage();
	if ($this->objectType === NULL) {
		$this->objectType = str_replace(array('\\Repository\\', 'Repository'), 
array('\\Model\\', ''), $this->FLOW3_AOP_Proxy_getProxyTargetClassName());
	$this->objectType = 'F3\MyPackage\Domain\Model\Account';

To tell the Security Framework that he work with the new Model i created 
a Configuration/Objects.yaml with this content

   autowiring: on
   className: F3\Tutorials\Domain\Model\Account

Now, i create a new User like

$roles = array();
$roles[] = $this->objectManager->create('F3\FLOW3\Security\Policy\Role', 
$account = $this->objectManager->create('F3\MyPacke\Domain\Model\Account');
$account->setName('Julian Kleinhans');
$account->setEmail('typo3 at kj187.de');
$account->setPaypal('xxx at kj187.de');

The user is created, but, i cant authentificate with this new user :-(
Any ideas or hints ?


More information about the TYPO3-project-5_0-general mailing list