Checks whether a user is linked to a service.
@private
332285
function(provider) {
        var authType;
        if (_.isString(provider)) {
          authType = provider;
        } else {
          authType = provider.getAuthType();
        }
        var authData = this.get('authData') || {};
        return !!authData[authType];
      }
1190711
function(name, service) {
  this.name = name;
  this.groups = {};       // group map for uids. key: sid, value: [uid]
  this.records = {};      // member records. key: uid
  this.__channelService__ = service;
  this.state = ST_INITED;
  this.userAmount =0;
}
265504
function(authStore, session) {
  var found = false;

  for (var i = 0; i < authStore.length; i++) {
    if (authStore[i].equal(session)) {
      found = true;
      break;
    }
  }

  if (!found) authStore.push(session);
}
220084
function checknick(next) {
        if (args.nick) {
          userent.list$({ nick: args.nick }, function(err, users) {
            if (err) return done(err, { ok: false, user: user })
            for (var i = 0; i < users.length; i++) {
              var each = users[i]
              if (each.id !== user.id) {
                return done(null, {
                  ok: false,
                  why: 'nick-exists',
                  nick: args.nick
                })
              }
            }

            next()
          })
          return
        }
        next()
      }
611862
private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) {
        return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null;
    }
155449
private ServiceReference checkService(ServiceReference serviceReference, String interfaceClassName)
    {
        if (serviceReference != null)
        {
            Object service = bundleContext.getService(serviceReference);
            if (service != null)
            {
                try {
                    if (interfaceClassName != null)
                        if (!service.getClass().isAssignableFrom(Class.forName(interfaceClassName)))
                            serviceReference = null;
                } catch (ClassNotFoundException e) {
                    // Ignore this error
                }
            }
        }
        return serviceReference;
    }
212499
function checkRequired(opts, queryObject, updatedObject){
  if((queryObject &&!queryObject.options) && !updatedObject){
    return;
  }
  const { __user: user, __reason: reason } = queryObject && queryObject.options || updatedObject;
  if (opts.required && (opts.required.includes("user") && !user ||
      opts.required.includes("reason") && !reason)
  ){
    return true;
  }
}
117591
function _linkOrCreateUser() {
    if(this.userInfo){ //If user exists link data
        return _linkIdentity(this.userInfo._id, 'instagram', this.options);
    }
    else {
        return _createUser.call(this)
                .then(function(user){
                    this.userInfo = user;
                }.bind(this));
    }
}
443478
def _is_whitelisted(self, req):
        """"""

        if not self.roles_whitelist:
            return False

        if not hasattr(req, 'context'):
            self.log.info("No context found.")
            return False

        if not hasattr(req.context, 'roles'):
            self.log.info("No roles found in context")
            return False

        roles = req.context.roles
        self.log.debug("Received request from user with roles: %s",
                       ' '.join(roles))
        for key in self.roles_whitelist:
            if key in roles:
                self.log.debug("User role (%s) is whitelisted.", key)
                return True

        return False
1305376
def is_lazy_user(user):
    
    # Anonymous users are not lazy.

    if user.is_anonymous:
        return False

    # Check the user backend. If the lazy signup backend
    # authenticated them, then the user is lazy.
    backend = getattr(user, 'backend', None)
    if backend == 'lazysignup.backends.LazySignupBackend':
        return True

    # Otherwise, we have to fall back to checking the database.
    from lazysignup.models import LazyUser
    return bool(LazyUser.objects.filter(user=user).count() > 0)
834680
async function isSymlink(filename){
    try{
        // get stats
        const stats = await _fs.lstat(filename);

        // is symlink ?
        return stats.isSymbolicLink();
    }catch(e){
        // file not found error ?
        if (e.code === 'ENOENT'){
            return false;
        }else{
            throw e;
        }
    }
}
701023
function(userProfileServiceInstance) {
    if (typeof userProfileServiceInstance.lookup !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'lookup\''));
    } else if (typeof userProfileServiceInstance.save !== 'function') {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_USER_PROFILE_SERVICE, MODULE_NAME, 'Missing function \'save\''));
    }
    return true;
  }
935604
function isAppInstalled(app, prefixes) {
  return new Promise((resolve) => {
    if (!(app in prefixes)) {
      return resolve(false)
    }

    Linking.canOpenURL(prefixes[app])
      .then((result) => {
        resolve(!!result)
      })
      .catch(() => resolve(false))
  })
}
903459
function (data) {
    var user = this$1.onSuccess(data);
    if (isFunction(onSuccess)) {
      onSuccess(user);
    }
    return user
  }
1362060
async function checkUnique (options, identifyUser, ownId, meta) {
  debug('checkUnique', identifyUser, ownId, meta);
  const usersService = options.app.service(options.service);
  const usersServiceIdName = usersService.id;
  const allProps = [];

  const keys = Object.keys(identifyUser).filter(
    key => !isNullsy(identifyUser[key])
  );

  try {
    for (let i = 0, ilen = keys.length; i < ilen; i++) {
      const prop = keys[i];
      const users = await usersService.find({ query: { [prop]: identifyUser[prop].trim() } });
      const items = Array.isArray(users) ? users : users.data;
      const isNotUnique = items.length > 1 ||
        (items.length === 1 && items[0][usersServiceIdName] !== ownId);
      allProps.push(isNotUnique ? prop : null);
    }
  } catch (err) {
    throw new errors.BadRequest(meta.noErrMsg ? null : 'checkUnique unexpected error.',
      { errors: { msg: err.message, $className: 'unexpected' } }
    );
  }

  const errProps = allProps.filter(prop => prop);

  if (errProps.length) {
    const errs = {};
    errProps.forEach(prop => { errs[prop] = 'Already taken.'; });

    throw new errors.BadRequest(meta.noErrMsg ? null : 'Values already taken.',
      { errors: errs }
    );
  }

  return null;
}
158843
function isAuthenticated() {
  var storageEngine = App.pkg.settings.storage_engine || 'localStorage';
  var name = App.pkg._id;
  var auth = window[App.pkg.settings.auth_module];
  if (window[storageEngine][name + '-session']) {
    var data = JSON.parse(window[storageEngine][name + '-session']);
    data['empty'] = false;
    window.user = new auth.models.User(data);
  } else {
    window.user = new auth.models.User();
  }
  return !window.user.get('empty');
}
1246680
function checkBrowser () {
        if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
            module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
            return true;
        }
        return false;
    }