Created
October 31, 2018 14:21
-
-
Save dasginganinja/b4e049d858339098452c0d453ce0c982 to your computer and use it in GitHub Desktop.
OG role override -- rule replacement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The rule I created to make this works is configured as follows: | |
-- Event: After updating an existing user account | |
-- Conditions: User has role(s) | |
-- -- Parameter: User: data selector: [account], Roles: value: story author override {this is a drupal role I created for this purpose}, | |
-- -- -- Match Roles: "if matching against all selected roles, the user must have ALL the roles selected" | |
-- -- -- Negate is not checked | |
-- Elements: | |
-- -- fetch entity by id: | |
-- -- -- Parameter: Entity type: Node, Identifier: 1 | |
-- -- -- Provides variables: Fetched entity (entity_fetched) | |
-- -- Fetch entity by property | |
-- -- -- Parameter: Entity type: Node, Property: Group, Value: True { Group } | |
-- -- -- Provided variables: Label: Fetched groups, name: entity_fetched_groups | |
-- -- -- Loop | |
-- -- -- -- -- Parameter: List: Data selector: entity-fetched-groups | |
-- -- -- -- -- Current List item: group in list, variable name: list_item | |
-- -- -- -- Subscribe user to group | |
-- -- -- -- -- Parameter: User: data selector: account, Group: data selector: list-item | |
-- -- -- -- Grant OG role | |
-- -- -- -- -- Parameter: User: data selector: account, Group: data selector: list-item, Group Roles: value: story author {an OG role I created for this purpose} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment