Adds the group to the given user

@param \Aimeos\MShop\Context\Item\Iface $context Aimeos context object
@param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object
496747
protected function addGroups( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user )
	{
		\Illuminate\Foundation\Auth\User::findOrFail( $user->getId() )
			->forceFill( ['superuser' => ( $this->option( 'super' ) ? 1 : 0 )] )
			->save();

		if( $this->option( 'admin' ) ) {
			$this->addGroup( $context, $user, 'admin' );
		}

		if( $this->option( 'editor' ) ) {
			$this->addGroup( $context, $user, 'editor' );
		}

		if( $this->option( 'api' ) ) {
			$this->addGroup( $context, $user, 'api' );
		}
	}
813992
public function onAsyncUserCreate(User $user)
    {
        if ($user['groupId']) {
            return;
        }

        $defaultGroupId = wei()->setting('user.defaultGroupId', 0);
        if ($defaultGroupId) {
            $user->updateGroup($defaultGroupId);
        }
    }
221003
private function createAddLinkGroupCenterForm(User $user)
    {
        return $this->createFormBuilder()
                ->setAction($this->generateUrl('admin_user_add_group_center', 
                        array('uid' => $user->getId())))
                ->setMethod('POST')
                ->add(self::FORM_GROUP_CENTER_COMPOSED, new ComposedGroupCenterType())
                ->add('submit', 'submit', array('label' => 'Add a new groupCenter'))
                ->getForm()
                ;
    }
985366
public static void changeUser(IUser user) {
        try {
            getUserContext().requestContextChange(user);
        } catch (Exception e) {
            log.error("Error during user context change.", e);
        }
    }
646593
def add_user_to_group(self, user, group_name):
        
        group, _ = Group.objects.get_or_create(name = group_name)
        group.user_set.add(user)
1068672
public function addUser(User $user)
    {
        if (!$this->users->contains($user)) {
            $this->users->add($user);
        }

        return $this;
    }
1184579
protected function unassignUserFromUserGroups(User $user, array $userGroups)
    {
        $existingUserGroups = $this->userService->loadUserGroupsOfUser($user);
        foreach ($existingUserGroups as $existingUserGroup) {
            if (!array_key_exists($existingUserGroup->id, $userGroups)) {
                $this->userService->unAssignUserFromUserGroup($user, $existingUserGroup);
            }
        }
    }
452349
protected function addDatabaseManager( \Aimeos\MShop\Context\Item\Iface $context )
	{
		$dbm = new \Aimeos\MW\DB\Manager\DBAL( $context->getConfig() );

		return $context->setDatabaseManager( $dbm );
	}
720445
public function includeContextOptions(User $user)
    {
        $contexts = $user->members;

        return $this->collection($contexts, new ContextOptionTransformer, 'contextOption');
    }
894096
public function addUser(\CampaignChain\Location\FacebookBundle\Entity\User $users)
    {
        $this->users[] = $users;

        return $this;
    }
213680
public function updateUserContext(UserContext $context): void
    {
        if ($this->session->isStarted()) {
            $context->addParameter('sessionId', $this->session->getId());
        }
    }
415442
protected static function addHasher( \Aimeos\MShop\Context\Item\Iface $context )
	{
		if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_hasher'] )
			&& is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_hasher'] ) )
		) {
			return $fcn( $context );
		}

		if( class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ) ) // TYPO3 9+
		{
			$factory = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' );
			$context->setHasherTypo3( $factory->getDefaultHashInstance( 'FE' ) );
		}
		elseif( class_exists( '\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory' ) ) // TYPO3 7/8
		{
			$context->setHasherTypo3( \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance() );
		}

		return $context;
	}
1068216
protected function _actionAdd(AnCommandContext  $context)
     {
         $data = $context->data;

         dispatch_plugin('user.onBeforeAddPerson', array('data' => $context->data));

         $person = parent::_actionAdd($context);

         $this->getRepository()
         ->getValidator()
         ->addValidation('givenName', 'required')
         ->addValidation('familyName', 'required')
         ->addValidation('usertype', 'required')
         ->addValidation('username', 'uniqueness')
         ->addValidation('email', 'uniqueness');

         if ($person->validate() === false) {
             throw new AnErrorException($person->getErrors(), AnHttpResponse::BAD_REQUEST);
         }

         $viewer = get_viewer();

         if (in_array($data->usertype, $this->_allowed_user_types)) {
             $person->usertype = $data->usertype;
         } else {
             $person->usertype = ComPeopleDomainEntityPerson::USERTYPE_REGISTERED;
         }

         dispatch_plugin('user.onAfterAddPerson', array('person' => $person));

         if ($person->admin()) {
             $this->registerCallback('after.add', array($this, 'mailAdminsNewAdmin'));
         }
         
         $context->response->setRedirect(route('option=com_people&view=people'));
         
         return $person;
     }
1215230
protected function addMessageQueueManager( \Aimeos\MShop\Context\Item\Iface $context )
	{
		$mq = new \Aimeos\MW\MQueue\Manager\Standard( $context->getConfig() );

		return $context->setMessageQueueManager( $mq );
	}
87522
def add_user_to_group(iam_client, user, group, quiet = False):
    
    if not quiet:
        printInfo('Adding user to group %s...' % group)
    iam_client.add_user_to_group(GroupName = group, UserName = user)
423787
protected static function addMessageQueueManager( \Aimeos\MShop\Context\Item\Iface $context )
	{
		if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_mqueue'] )
			&& is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_mqueue'] ) )
		) {
			return $fcn( $context );
		}

		return $context->setMessageQueueManager( new \Aimeos\MW\MQueue\Manager\Standard( $context->getConfig() ) );
	}
777527
protected static function addMailer( \Aimeos\MShop\Context\Item\Iface $context )
	{
		if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_mailer'] )
			&& is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_context_mailer'] ) )
		) {
			return $fcn( $context );
		}

		return $context->setMail( new \Aimeos\MW\Mail\Typo3( function() {
			return GeneralUtility::makeInstance( \TYPO3\CMS\Core\Mail\MailMessage::class );
		} ) );
	}