attach_user(context, id, user_id)

    Attach a user to a remoteci.

    >>> dcictl remoteci-attach-user [OPTIONS]

    :param string id: ID of the remoteci to attach the user to [required]
    :param string user_id: ID of the user to attach [required]
420881
def attach_user(context, id, user_id):
    
    result = remoteci.add_user(context, id=id,
                               user_id=user_id)
    utils.format_output(result, context.format, ['remoteci_id', 'user_id'])
63095
function insertUser (client, { id, name, organizationId, metadata }, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      id = id || uuidV4()

      const sqlQuery = SQL`
        INSERT INTO users (
          id, name, org_id, metadata
        ) VALUES (
          ${id}, ${name}, ${organizationId}, ${metadata}
        )
        RETURNING id
      `

      client.query(sqlQuery, (err, result) => {
        if (utils.isUniqueViolationError(err)) return cb(Boom.conflict(err.detail))
        if (err) return cb(Boom.badImplementation(err))

        cb(null, result)
      })

      return promise
    }
990722
def delete_user(self, user_id, **kwargs):
        
        return DeleteUser(settings=self.settings, **kwargs).call(user_id=user_id, **kwargs)
130121
public function attachUser( $user )
  {
    if( is_object($user))
      $user = $user->getKey();

    if( is_array($user))
      $user = $user['id'];

    $this->users()->attach( $user );
  }
25561
function connect(uri, cb) {
  _ci = url.parse(uri)
  _nano = NANO(_ci.protocol+'//'+(_ci.auth?_ci.auth+'@':'')+_ci.host+'')
  
  // Get _security of _users and use it as a template
  getSecurity('_users', function(err, d) {
    // Looks like we are not allowed to do this
    if(err) return cb(err)
    
    // As the user within uri is allowed to fetch _securtiy,
    // she will 'probably' be allowed to add itself to _security:
    if(_ci.auth) {
      var user = _ci.auth.split(':',1).shift()
      if(d.admins.names.indexOf(user) === -1) {
        d.admins.names.push(user)
      }
      if(d.readers.names.indexOf(user) === -1) {
        d.readers.names.push(user)
      }
    }
    
    // Sets the template for further _security changes
    _security = mergeSecurity(_security, d)
    
    // Write _security to _users
    setSecurity('_users', _security, function(err) {
      if(err) return cb(err)
      cb()
    })
  })
}
1048228
def add_member(self, user):
        
        user = Transform.to_user(user)
        data = {
            'id': user
        }
        extra = {
            'resource': self.__class__.__name__,
            'query': {
                'id': self.id,
                'data': data,
            }
        }
        logger.info('Adding team member using id', extra=extra)
        response = self._api.post(
            url=self._URL['members_query'].format(id=self.id), data=data)
        member_data = response.json()
        return TeamMember(api=self._api, **member_data)
819132
def auth_user_remote_user(self, username):
        
        user = self.find_user(username=username)

        # User does not exist, create one if auto user registration.
        if user is None and self.auth_user_registration:
            user = self.add_user(
                # All we have is REMOTE_USER, so we set
                # the other fields to blank.
                username=username,
                first_name=username,
                last_name="-",
                email="-",
                role=self.find_role(self.auth_user_registration_role),
            )

        # If user does not exist on the DB and not auto user registration,
        # or user is inactive, go away.
        elif user is None or (not user.is_active):
            log.info(LOGMSG_WAR_SEC_LOGIN_FAILED.format(username))
            return None

        self.update_user_auth_stat(user)
        return user
1212255
def get_user(self, id):
        
        self.assert_has_permission('scim.read')
        return self._get(self.uri + '/Users/%s' % (id))
826735
def create_connection(self, userid):
        '''  '''
        req_hook = 'pod/v1/connection/create'
        req_args = '{ "userId": %s }' % userid
        status_code, response = self.__rest__.POST_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1089747
def attach_issue(context, id, url):
    

    result = job.attach_issue(context, id=id, url=url)
    utils.format_output(result, context.format)
559635
def tag_user(self, tag_id, user_id):
        
        data = {'tagid': tag_id}
        if isinstance(user_id, (tuple, list)):
            data['openid_list'] = user_id
        else:
            data['openid_list'] = [user_id, ]
        return self._post('tags/members/batchtagging', data=data)
474381
def chuid(name, uid):
    '''
    
    '''
    if not isinstance(uid, int):
        raise SaltInvocationError('uid must be an integer')
    pre_info = info(name)
    if not pre_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    if uid == pre_info['uid']:
        return True
    _dscl(
        ['/Users/{0}'.format(name), 'UniqueID', pre_info['uid'], uid],
        ctype='change'
    )
    # dscl buffers changes, sleep 1 second before checking if new value
    # matches desired value
    time.sleep(1)
    return info(name).get('uid') == uid
912344
def user_to_uid(user):
    '''
    
    '''
    if user is None:
        user = salt.utils.user.get_user()

    return salt.utils.win_dacl.get_sid_string(user)
1003944
function _draw_remote_id(id_string){
	function _process_resp(resp){
	    var doc = resp.get_doc(0);
	    _draw_local_doc(doc);
	}
	anchor.register('search', 'do', _process_resp);
	anchor.set_id(id_string);
	//ll('FOO: ' + id_string);
	anchor.search();
    }
626075
def set_user(user, sender, instance, **kwargs):
        
        try:
            app_label, model_name = settings.AUTH_USER_MODEL.split('.')
            auth_user_model = apps.get_model(app_label, model_name)
        except ValueError:
            auth_user_model = apps.get_model('auth', 'user')
        if sender == LogAction and isinstance(user, auth_user_model) and instance.user is None:
            instance.user = user
        if hasattr(threadlocal, 'actionslog'):
            instance.remote_ip = threadlocal.actionslog['remote_ip']
448843
protected function attachRoleToUser($role, $userId)
    {
        // Check if user exists
        if ($user = $this->userRepository->findById($userId)) {
            $user->attachRole($role);
            $this->info('Role attached successfully to user');
        } else {
            $this->error('Not possible to attach role. User not found');
        }
    }
1221867
def attach(options = {})
      options = Aws::Util.deep_merge(options,
        auto_scaling_group_name: @group_name,
        instance_ids: [@id]
      )
      resp = @client.attach_instances(options)
      resp.data
    end