I am looking for a way to assign domain access to a user after he has updated a node.
This should work exactly like "rules_action_set_node_domain - Set domain to a node".
But instead of "Set domain to a node" it must "Set domain to a user"
And the user is the user id (node author) of the node created.
Why I need this feature. Well if you user node reference and want to enable the user to publish his referenced content to the same domains as his parent node, there is no way to do it.
Here is an example: Lets say you have a content type gallery, and you have a node reference field that reference image content types. Now you create a Gallery called Birds, with some arguments (rules_action_set_node_domain) it publish the node to birds.com. Now you create a image node that reference to your birds node, but you can not select to publish this content to birds.com
You need to give the user permanent access to birds.com in his user account when he created the gallery node, in this way he can select if he want to publish referenced image nodes to birds.com or not.
"rules_action_set_user_defaults_domain - set a given role access to a given domain" Is not what I want, I want user access to a given domain
Any Help Please
Comments
Comment #1
vlooivlerke commentedHere is my first try but I must be doing someting wrong. I need it to insert the new domain_id with the node uid in the domain_editor table.
domain_rules.rules.inc line 41 ...function domain_rules_action_info() {
Line 159
I know the problem is in this top part of the code, I dont know exactly how to insert into a database properly and i dont know how to get the correct uid from the current node.
domain_rules.rules_forms.inc line 88
Hope this help to get this on the roll.
Comment #2
shushu commentedHi @vlooivlerke, thanks for the offer of the new feature.
I implemented it in the 6.x dev branch, and it seems to work as you requested.
I try to avoid any direct db queries, hence my solution is a bit different.
Please try out the new version (should be in http://drupal.org/node/1660478 in couple of hours), and let me know if it works for you.
Regards,
Shushu
Comment #3
vlooivlerke commentedThanks @Shushu
It works perfect for me :)
edit: must say it is very well done, thanks again.
Comment #4
shushu commentedNo problem. I will try to release a "final" version in few days, including 7.x version.
Comment #6
roeneman commentedSubscribing, I hope you will get around to the 7.x version shortly. Would be great. Thanks!
Comment #7
shushu commentedDone, hopefully works as expected on D7 as well.
Please try the latest 7.x-1.1
And please notify in case of a problem
Regards,
Shushu
Comment #8
roeneman commentedThe D7 version works at my system! Great, thanks shushu.
This option is probably very usefull for all cases where users are created by/through Rules, while running Domain Access. Without setting a domain for a user such user is of no much use, in my experience.
One hint when starting to use this: The 'set domain to a user' option takes url's as addresses but without the protocol (like: example.com and so without the http:// /). Therefore replacement [site:url-brief] works (note the 'brief' part).
Cheers.
Comment #9
tparc commentedThe above comment should be documented somewhere besides here...just saying. At least I haven't seen it anywhere else.