[Flow] Flow 2.0 and roles
François Suter
fsu-lists at cobweb.ch
Tue Jan 7 14:40:23 CET 2014
Hi all,
I got help in the IRC channel, so here's the solution for anyone up with
the same problem.
> How are roles supposed to be handled in Flow 2.0? Is there any example
> code somewhere?
In my updateAction, I was just passing the array of strings representing
the roles from the form to the \TYPO3\Flow\Security\Account::setRoles()
method.
These roles need to be converted to objects first, with something like:
$roleObjects = new \Doctrine\Common\Collections\ArrayCollection();
foreach ($filteredRoles as $aRole) {
$roleObjects->add($this->policyService->getRole($aRole));
}
$account->setRoles($roleObjects);
Cheers
--
Francois Suter
Work: Cobweb Development Sarl - http://www.cobweb.ch
TYPO3: Help the project! - http://typo3.org/contribute/
Appreciate my work? Support me -
http://www.monpetitcoin.com/en/francois/support-me/
More information about the Flow
mailing list