getAcl()->checkScope('Email')) { throw new Forbidden(); } if (!$this->getAcl()->checkScope('Email', 'create')) { throw new Forbidden(); } $q = $request->get('q'); $maxSize = intval($request->get('maxSize')); if (empty($maxSize) || $maxSize > 50) { $maxSize = $this->getConfig()->get('recordsPerPage', 20); } return $this->getRecordService()->searchInAddressBook($q, $maxSize); } }