getAcl()->checkScope('Attachment', 'create')) { throw new Forbidden(); } $attachment = $this->getRecordService()->upload($data); return array( 'attachmentId' => $attachment->id ); } }