Skip to content

Instantly share code, notes, and snippets.

@tarekdj
Created January 2, 2014 12:23
Show Gist options
  • Save tarekdj/8218514 to your computer and use it in GitHub Desktop.
Save tarekdj/8218514 to your computer and use it in GitHub Desktop.
Rule export
{ "rules_when_creating_node_create_user" : {
"LABEL" : "when creating node create user",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "custom_rules", "devel", "rules", "content_access_rules" ],
"ON" : { "node_insert" : [] },
"DO" : [
{ "add_password" : {
"USING" : { "length" : "8" },
"PROVIDE" : { "password_added" : { "password_added" : "Generated password" } }
}
},
{ "devel_debug" : { "value" : [ "password-added" ] } },
{ "create_custom_user" : {
"USING" : {
"login" : "user-[node:nid]",
"password" : "[password-added:value]",
"email" : "user-[node:nid]@test.com"
},
"PROVIDE" : { "user_added" : { "user_added" : "Generated user" } }
}
},
{ "devel_debug" : { "value" : [ "user-added" ] } },
{ "content_access_action_user_grant" : {
"node" : [ "node" ],
"content_access_user_view" : [ "" ],
"content_access_user_update" : [ "user-added" ],
"content_access_user_delete" : [ "" ]
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment