How do I allow users to access only their cck-created content page.
public
rdrew@drupal.org - Mon, 2007-07-30 16:43
I have created a 'new content type' using cck and have given an authenticated user permission to create new content (fill out a form) using this new content type. So far so good. Say that each user creates 1 or 2 instances of this new content type, how do I allow them to go back and edit only the ones that they created? I am just getting used to the terminology and I hope my question makes sense.
Any ideas?
Rob Drew


Here is an idea
first make a theme file for this content type (node-your_content_type.tpl.php).
Then you can get the uid (user id) of the node and compare it to the current user's id ($user->uid be sure to do global $user first) to see if its theirs.
Next you can query the db (node table) for how many nodes of this type the user has created (there is a type field in the node table too). If there is already a node of this type by this by this user, you can disallow another node creation.
You know you need hook_form_alter for that I think so you might need to just make a module instead of putting this in the theme file - look up hook_form_alter on api.drupal.org or better yet, get the Pro Drupal book
Good luck
UH?
Um, just set the "edit my content-type" permission to the role to which the user belongs...? If you're finding that you want certain authenticated users to do things that others can't, then you need to set up more roles and assign the permissions accordingly.
I'm sorry, but this is not
I'm sorry, but this is not the place for these kind of questions. If you asked it on the irc nets, we'd be happy to help, but this is not general drupal support. We already have forums for that here.
Drupal Dojo - Thelifeofme.com
Sorry....
Sorry. I just thought that the cck group may be a good place to ask a cck related question. I'm fairly new to drupal development and obviously to the groups as well.
Rob Drew
Rob, Squidgy was referring
Rob,
Squidgy was referring to not using the Drupal Dojo group for support. The purpose of the dojo is to train up and coming Drupal Ninja's, not to be another support forum. You posted your question in multiple groups, which isn't best practice unless the post is completely relevant to both groups. Your post is relevant to the CCK group but not necessarily relevant to the Drupal Dojo.
Also the CCK group is there for discussion of CCK development and not necessarily for support. The best place for you to post your question would be in the support forums or on IRC at #drupal-support.
Ahh... Gotcha.
Ahh... Gotcha. That makes sense. Thanks for info.
cheers
rob
cck support forum ?
squidgy:
hello. i checked the url you mentioned above http://drupal.org/forum/18 . which of the forum listed in there
can one post questions regarding CCK help ?
thx.
yashesh bhatia.
The link is for all the
The link is for all the support forums. If you are posting a question regarding something after you have finished installing Drupal, you would post your question to the Post installation forum.