protected function _getUser()
 {
     $userId = $this->getRequest()->getParam('id');
     if (!$userId) {
         throw new MissingParameterException("Needed parameter was not found. userId.");
     }
     $type = 'id';
     if (strpos($userId, ':') !== false) {
         list($type, $userId) = explode(':', $userId, 2);
     }
     switch ($type) {
         case 'id':
             $user = $this->_userSrv->load($userId);
             break;
         case 'username':
             $user = $this->_userSrv->loadByUserName($userId);
             break;
         default:
             throw new InvalidArgumentException("Invalid parameter value: userId");
     }
     if (!$user) {
         throw new NotFoundException("Resource user does not exist");
     }
     $this->_helper->allowed('read', $user);
     return $user;
 }