2

I have a Drupal 7.0 social site with three roles, each with a profile they may or may not want other roles to see all/part of. I'm not sure how to allow the user to specify which fields can be viewed by each role, but this is my current idea:

  • Create an on/off checkbox to signal view permission for each role per profile field
  • Use the views module to present profile, filters allowed view of each profile field
  • Similarly, when editing a profile, it will be presented with a view module so that corresponding role permission checkboxes can show next to it.

I imagine 'edit profile' could look similar to Drupal permissions (except under permissions would be the profile fields instead of module/feature list): quick view of permissions

I'm clear on how to set up the view such that any given role can see each profile field that has been checked.

But is this possible to make it so when the user is setting up their profile, they see a view to add/edit profile2 with inline permission boxes instead of the default profile form that hasn't any such checkboxes?

Perhaps I would need customize adding in hook_form_alter or can this all be done in the UI?

0

Instead you can try Profile2 Privacy module, It will do your requirement exactly.

This module extends Profile 2 by allowing administrators to create privacy levels as predefined groups or sets of profile fields on a per role basis. Users can then select from among the privacy levels to apply access control to their profile.

For each role, select the profile fields that are visible to users in that role, when the profile owner has selected this role. For example, if you created an “authenticated users only” privacy level, you might set the anonymous role to view first and last name fields, the authenticated role to see first name, last name and contact fields and an admin role to see all fields.

  • Excellent this looks very promising and just what I was looking for. Thanks! – vrwired Sep 26 '13 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.