Posted by zdean on November 10, 2009 at 4:53am
Jump to:
| Project: | Node Limit Number |
| Version: | 6.x-2.0-alpha1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I would like to limit each role "Editor" to create only 1 node type "Firm Profile". After that quota has been reached, I would like either:
1. the user is redirected to the "Firm Profile" that they created, or
2. the user's role is changed to "Editor 2" so that they no longer have permission to create the node type "Firm Profile" (the creation link no longer shows), or
3. The link to create the node type no longer is visible.
Is any one of these scenarios possible?
Thanks for your great work!
Comments
#1
I'm doing something similar by querying the db for the nid of the user's previously created node of the limited type. I use this php code:
$row = db_fetch_array(db_query("SELECT nid FROM {node} WHERE type LIKE 'my_content_type' AND uid = $user->uid"));
$node = node_load(array('nid' => $row['nid']));
return array("node" => $node);
Then I do a page redirect rule to a tokenized url:
node/[node:nid]
It works well on my site - hope this helps.
#2
Yes, they are all possible. #2 is probably the quick and dirty way to do it. You won't need any custom php code either. Just add an action to remove the user role they currently have and then add another action to add a user role that will limit them.
#3
Closing due to inactivity