public function modifyAction($teamId)
{
if (!$this->getUser()->canManageAcl()) {
throw new ApiInsufficientPermissionsException();
}
$object = $this->request->getJsonBody();
/* @var $teamAdapter TeamAdapter */
$teamAdapter = $this->adapter('team');
//Pre validates the request object
$teamAdapter->validateObject($object, Request::METHOD_PATCH);
$team = $this->getTeam($teamId);
//Copies all alterable properties to fetched Role Entity
$teamAdapter->copyAlterableProperties($object, $team);
//Re-validates an Entity
$teamAdapter->validateEntity($team);
//Saves verified results
$team->save();
return $this->result($teamAdapter->toData($team));
}