Role based profile elements
mattwalston - January 28, 2006 - 19:17
| Project: | Drupal |
| Version: | 4.6.6 |
| Component: | profile.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
The profile module could use Roles to determine wether or not a field was relevant to the particular user. This feature should be a relatively simple implementation and increase usability of drupal on directory listing style sites.

#1
I think not only fields but a field sets (Categories) could be role-tied.
#2
Very strong point. The fieldset would be the primary thing that people would want to control. I am changing version to CVS since 4.6.5 is not getting new features. Should this be done in profile or another module?
#3
I think control above categories is very handy. Bacause you may turn on/off a group of fields with one click.
Also role-based control is very usefule for many sites. Imagine: as user acquires new role, so he/she gets a set of filelds in the profile.
I think this feature should be in profile module, because other profile settings are located there and it's logically to meet them here.
I think it will be good to make a list of categories (field sets) as a separate object.
Each set can have properties like: id, name, description, roles. Sets could be added, renamed or deleted in an speciel interface. Next, when user defines a filed he doesn't write a categorie name, but selects it from the drop-down list.
#4
I am using Drupal 4.6 and I need this feature. The patch I created defines permission named 'edit category' where category is profile category. Then the administrator can use access control to assign which role can have which profile category. For example, 'student user' role can have 'Student' profile category but 'teacher user' role does not have 'Student' profile.
In my case, I also have some fields that not allow a user to editor the field by self, but selected role can edit that field. For example, there are 'student user' role, the administrator assign/edit 'grade' field, it shows on the profile page but a student can not edit that field. This patch has a checkbox in the 'add new ... field', to flag this kind of field.
I have to alter the profile_fields table too.
ALTER TABLE profile_fields ADD profile_admin_field TINYINT(1) DEFAULT 0 NOT NULL;#5
I'm sorry. My previous patch has an error when adding a new filed. This patch fixes this problem.
#6
This issue is a duplicate of the issue located at http://drupal.org/node/14149. Please move all discussion and patches to that bug.
Robin
I ♥ Bugz