I have Role A, with content profile cp_a, and Role B, with content profile cp_b. I want to give users with Role A the permission to create users with Role B (possible thanks to Role delegation module) and the permission to fill their content profile; so it seems I would need the following permissions:
Role A Role B
create cp_a content X
create cp_b content X X
delete any cp_a content
delete any cp_b content X
delete own cp_a content X
delete own cp_b content X
edit any cp_a content
edit any cp_b content X
edit own cp_a content X
edit own cp_b content X
However, this will make cp_b a content profile for Role A, because content_profile relies on the "create CONTENT_TYPE content" permission to link content types to roles.
See some similar (recent) issues: #375454: Make CP role aware, #598212: Enable administrators to manage other users content profiles, #425144: Other user's profile creation requires "administer content" privilege..
I have created a patch (against 6.x-1.0-beta4) similar to #375454: Make CP role aware (issue closed, but the patch was not integrated) that let site admins link a content type to specific roles in the Content Profile section of a content type edit page. Also, when a content profile node is created for a user, its uid is automatically set to the uid of this user (not the uid of the node creator), even if the node creator does not have the "administer node" permission.
Note that a Role A user can still create a cp_b through the node/add/cp_b URL; however, it will not be shown in its profile.
This patch includes an update to the database (content_profile_update_6005), so you need to run update.php after installing this patch. I strongly advise you to backup your database first.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | content_profile-role-aware-3.patch | 8.65 KB | Anonymous (not verified) |
| #6 | content_profile-role-aware-2.patch | 8.24 KB | Anonymous (not verified) |
| content_profile-role-aware.patch | 8.08 KB | pfournier |
Comments
Comment #1
pfournier commentedUpdate:
This patch includes an update to the database (content_profile_update_6005), so you need to run update.php after installing this patch. I strongly advise you to backup your database first.Comment #2
cyberwolf commentedAm I right in saying that this code adds a new requirement to the profile nodes: that its descriptive name needs to match the user login name?
A similar discussion is going on here: http://drupal.org/node/425144.
Comment #3
cyberwolf commentedNever mind my remarks about the patch. $node->name apparently refers to the name of the user with id $node->uid. It gets loaded into $node by node_load().
Comment #4
finex commentedI'd like this feature too.
Comment #5
marcus_clements commented+1
Comment #6
Anonymous (not verified) commentedIt appears that the line numbering for version 1.0 is off causing hunk #3 (at line 93) to fail, because the hunk should now start at 94. I'm uploading the same patch but with the correct line number.
Comment #7
Anonymous (not verified) commentedOops, that was a Mercurial diff instead of a regular diff. Re-attaching.
Comment #8
dawansv commentedFilmKnurd: I wanted to try your last patch but it looks like you created that last patch backward (the patch reverts the new code to the old code)...
--- ./content_profile.install 2010-08-12 10:58:46.000000000 -0500
+++ ../content_profile.orig/content_profile.install 2010-08-12 10:58:30.000000000 -0500