0

I'm trying to accomplish the task -" If the User is added to a specific CiviCRM group manually by admin/'users with permissions to add to group', The added user should be blocked.I'm using Rules module with CiviCRM entities.

Here is my Rules export:

{ "rules_block_unblock_user" : {
    "LABEL" : "Block\/unblock user",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "civicrm_entity", "rules", "civicrm" ],
    "ON" : { "civicrm_group_edit" : [] },
    "IF" : [
      { "civicrm_entity_contact_is_in_group" : {
          "civicrm_contact" : [ "site:current-user:civicrm-contact" ],
          "group_id" : "2"
        }
      }
    ],
    "DO" : [ { "user_block" : { "account" : [ "site:current-user" ] } } ]
  }
}

I guess I'm not selecting the right data selectors. Any help?

0

Not sure which tokens you have available to select from, but the token site:current-user refers to the user performing the add to group, i.e. some "admin/'users with permissions to add to group". So your Rules Condition seems to be wrong. Due to which your Rules Action is not performed either of course.

And if the list of available tokens doesn't seem to have any relevant token, it may be because you're using the wrong Rules Event.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.