Hello,

I'm creating a website that is going to have various roles. I would like to allow / display certain profile categories based on the assigned role a user has and not simply have the profile categories showing on every user edit view.

If this is not possible, is there a way to create tabs / options within a certain user that would contain a form which would post data to the database?

I'm familiar with the hook_user method, but not sure how I would attach menu items to the Edit view that are similar to categories. Any direction would be helpful.

Thank you in advance.

Comments

WorldFallz’s picture

You should be able to create different profile types with the http://drupal.org/project/content_profile module and assign different roles/profile types with http://drupal.org/project/autoassignrole.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

parkej60’s picture

Thanks for the quick reply.

The autoassign role will be useful in later development because I will need to have accounts that are created by the users / registrants themselves autoassigned to a registrant role.

However I'm not sure the content_profile will do what I'm looking for. Here's an example:

I have an account manager role assigned to John Doe. John Doe needs to create a user which has a role of registrant for Dr. X and enter all of the information about this person into there field (I.E. First Name, Last Name), but the created Dr. X user cannot modify their information only the account manager can.

Furthermore the account manager also needs to create another user for Company X with a role of client which has a different list of field options available then the role of registrant.(I.E. Company Name, W-9 Number).

I hope this makes sense. Maybe Drupal is not the best way to go about doing something like this. I think if I could just figure out how to add an additional tab to a user (I.E. View, Edit, Track) such as Contact Information which is based off of the role assigned I could then create the forms within there and have them post to specific databases.

As always any help is appreciated.

WorldFallz’s picture

i've not tried it, but i believe content_profile can handle this for you. With profiles as full nodes, you should be able to prevent the user from editing their profile by not giving them the "edit own" permission for the content type you used for the profile. Also, content_profile allows for multiple content types to serve as profiles.

As for tabs, the core profile module inserts it's information into different tabs but it's more limited than content_profile. Might be worth trying though.

For tabs with content_profile profiles i would look at the http://drupal.org/project/panels module--though it's not quite ready for prime time on d6 yet.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

parkej60’s picture

So I've got the profile_content module installed and when I click on the user's to edit their profile information the only one that gives me the option to edit / create the profile information is the admin profile.

I'm logged in as admin so I should have access to edit this on all of the accounts, so it doesn't seem like it would be a permission issue. Am I missing some kind of role assignment?

***UPDATE***

So as far as I can tell the only time you can edit the profile_content information is when you're logged in as that particular user. Does anyone know if this is true or if I have some setting turned off / on that disallows this?

WorldFallz’s picture

So as far as I can tell the only time you can edit the profile_content information is when you're logged in as that particular user.

I'm using the current dev version of content_profile and when I'm logged in as user 1 I can edit any profile-- i don't remember setting an option anywhere to be able to do this.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Ogredude’s picture

Of course you can edit any profile when you're logged in as user 1. User 1 has the 'administer nodes' permission. This is normal operation.