Hello,
I created several custom profile fields.
I'd like to have each custom profile field for authenticated user to not be editable except from administrator role, I don't want the authenticated user to modify it after it's registration process.
Example: a custom profile field called "company" has been created, then I would like the user to enter it's pertaining info (on the dregistration process) and afterwards when he has registered and is an authenticated user, have that custom profile field be editable only by an allowed specific role via permissions (say the administrator role), I don't want the authenticated user to edit it by going into his/her personal user profile and edit it (/user/xxx/edit).
It would be nice to be able to assign permission of editing own custom profile fields at the role level, that is allow/deny some roles to be able to edit or not their own custom profile fields, and of course user/1 should have access to edit all users custom profile fields
Can someone please explain how to achieve this ?
Comments
did you check Permissions /
did you check Permissions / something like 'edit own profile' ?
That permission does not exist
grigori:
That permission you have posted does not exist in Drupal 6.9
any updates ???
I am also facing the same (but more complex) problem
but I want that users can not edit the particular category's fields in profile
1v1337 7hakkar
Maybe...
A simple solution, but it could work.
Try to make your own module with a hook_form_alter() function, like this :
RG, this didn't work for me.
RG, this didn't work for me. I have a category titled "Sponsorship Information" and in that category two fields called "profile_sponsor_company" and "profile_sponsorship_you_are_requesting." The first is a text field and the second is a drop down select.
Would that change the syntax? I tried using Devel to find the variables I need, but I didn't see the $form reference.
Any help is very appreciated.
Here is my custom module:
This function work for me
This function work for me (form_user_profile_form_alter) - function MYMODULE_form_user_profile_form_alter(&$form, &$form_state, $form_id)
I would be interested as
I would be interested as well.
Ideally I'd like the field to be editable as long as something is entered. ie. if at registration time nothing is filled in, then the field can be edited later by the user. But as soon as it's value is different from empty, then it becomes uneditable/locked.
I'm pretty sure such a module must already exist, since the functionnality was available already in Drupal 4.. but how to find it that is my question..
_
You might be able to do this with a combination of http://drupal.org/project/userprotect and http://drupal.org/project/rules, but it's probably easier to just use the snippet above and add an "if" to check if the field is empty and make it read only instead of unsetting it entirely.
Profile Permission module
Hi there,
Not sure if I am interpreting the intended end use exactly, however I recently had a similar problem. I found that a combination of the user protect module & http://drupal.org/project/profile_permission solved this issue.
edan.