I have a similar need for the NodeReview module, and solved it using weird permission handling as well. Specifically, hook_access() for the node type returns false for create permissions if on the node/add page. That works for everyone except uid 1. Have a look at the code if you're interested. I talked with chx in Sunnyvale about a nicer way of doing it in Drupal 6, and we determined that hook_menu_alter() was The Solution(tm). --Larry Garfield On Wed, 5 Dec 2007 20:46:49 +0800, "Augustin (Beginner)" <drupal.beginner@wechange.org> wrote:
Hello,
I was wondering: Hasn't anyone ever felt bothered by the complete listing of the available node types at /node/add (where the user has create permission)?
I am the only one who sometimes wishes there were a way to NOT list some node type on this list, even though the user has the proper permission?
Here is a simple scenario. We have a Problem node type and a Solution node type, in a way that each Solution is attached to a corresponding Problem. The user can create both Problems and Solutions, but the Solution are best created when following a link from the Problem node, so that we can customize the link thus: /node/add/solution?problem_id=123
Now if the user goes to /node/add and from there to /node/add/solution there is no problem_id defined.
Obviously, there are many different workarounds, e.g. by creating an intermediary form to select the parent node. But I run into this problem often and all my workarounds feel like hacks and I am getting tired of them.
What do you think? Would it be a useful feature for D7 to modify the second half of the function node_add() so that the listing can be customized?
Or am I doing something wrong, or I am the only one facing this problem?
thanks,
Augustin.