By djtech on
I would like to add a "group" field to my users so that I can use the Views 2 module to filter a view by this group. This way, if a user is a member of different roles, I can still share views amongst members as long as they are in the same group. Is there a module out there that can let me do this easily and quickly? I use CCK to create my forms. The only way I can think of is by somehow adding a field to the user profile to allow me to assign such a "group" value to. Any suggestions?
Comments
Profile
If you enable the core Profile module, you can add a custom 'groups' field to user profiles. Then, just filter on that field in your view.
Almost there
Thanks for the info, I should have figured that one out on my own! ...But it is not quite what I need. I'd like for this field to be displayed to the user in their profile, but not let them edit it. I set visibility to "Private field, content only available to privileged users." which shows up fine, but when I log in as the user, I can still edit that field. I only want an administrator to edit this field. I looked in the permissions, but did not see any options to achieve this. How is the "privileged" user defined? How can I prevent the user from editing it?
where are native profile field permissions?
This is exactly my question today. I can add the field to Profile, it shows up to the superuser, but there doesn't seem to be a way to set the viewing permissions on that field. Like djtech, there is nothing in my permissions to set View/edit rights to my roles. Missing?
I could add my field to my Content Profile content type. But then it would show up to the Admin under the user's "Bio" tab (the name of my CP) This is not horrible, as I would have all the power of views to use on it and I can easily set my permissions. Its just I hate a loose end like this. Where are the native drupal profile field permission settings?
What I really need is for my multi-line "Admin Notes" field to appear on the Account page of the user's profile, visible/editable to anyone with the Admin role and completely invisible to everyone else. Should be simple.
Another Role
Another option would be to add a third role. So, if user 1 has role a, and user 2 has role b, you could assign role c to both. Then, user 1 will have role a & c, and user 2 will have role b & c.
I don't think there is anyway to prevent a user from editing their own profile fields.