Hi,
I use Social Auth LinkedIn module, Now I want to add role when new user added by this module.
No luck on this, I added

Action: Add user role
User: @user.current_user_context:current_user
Role: new user

Need help

Comments

Eevvee created an issue. See original summary.

Eevvee’s picture

Version: 6.x-1.0-alpha1 » 8.x-3.x-dev
tr’s picture

Status: Active » Postponed (maintainer needs more info)

No luck on this

What does that mean? What happened? An export of your rule would help us to try to reproduce the problem...

tr’s picture

Status: Postponed (maintainer needs more info) » Fixed

Well, this works to set a role for a new user. This rule reacts on a new user being created, and assigns that new user a role with machine name "granted_by_rules". You can import this onto your site and see how it's configured.

langcode: en
status: true
dependencies: {  }
id: set_a_role_for_new_users
label: 'Set a role for new users.'
events:
  -
    event_name: 'rules_entity_insert:user'
description: ''
tags: {  }
config_version: '3'
expression:
  id: rules_rule
  uuid: 36de9619-1401-4b21-a651-d3927c5b8dac
  conditions:
    id: rules_and
    uuid: 416e90b0-d24c-4f37-8272-de0ecee5c375
    conditions: {  }
  actions:
    id: rules_action_set
    uuid: 2933681a-a079-496d-bc79-f27ff53144eb
    actions:
      -
        id: rules_action
        uuid: 38e8a3bb-0470-427f-80e1-53f6a703e8bf
        context_values:
          roles:
            - granted_by_rules
        context_mapping:
          user: user
        context_processors:
          roles:
            rules_tokens: {  }
        provides_mapping: {  }
        action_id: rules_user_role_add

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.