Hello and I hope someone can help me.

I have a situation where I need to allow 3 user profiles fields which are computed from the values of other user profile fields to be viewable by other anonymous and authenticated users.

To be more specific I have the computed fields Full Name, Public Phone, and Public Email which are computed from the values of other profile fields and only have values if the user checks the user profile field called "List in Public Directory".

Using the field permissions module I have set these 3 fields to be viewable by anonymous and authenticated users.

But no user profile fields are viewable by other anonymous and authenticated users, even the non-computed fields, unless I set the general permission of "View user profiles" for those roles. And I just can't allow everyone to see the entire profile.

Anyone have any ideas how I can get around this? I'm open to any solution.

Thanks for any and all help in advance!
Steve

Comments

kruser’s picture

Hi, Did you ever figure this out? If so, what is the solution?

Kristi Wachter’s picture

Issue summary: View changes

One way to do this would be grant anonymous users permission to view User Profiles (which would give them the ability to view individual profile fields), then use Rules to create a rule redirecting any anonymous users who try to view a full User Profile page.

You can define rules at http://example.com/admin/config/workflow/rules .

Here's an example Rule definition:

Event: User account page is viewed

Conditions: User has role(s)
Parameter: User: [site:current-user], Roles: anonymous user

Actions: Page redirect (to your existing Access Denied page)

mariacha1’s picture

Status: Active » Closed (duplicate)

The solution of using profile2 given in this thread seems relevant:
https://www.drupal.org/node/2192901

Marking as duplicate in an attempt to funnel all these requests there.