Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-2.8
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2009 at 19:41 UTC
Updated:
20 Dec 2009 at 13:01 UTC
I want to build a view that displays one set of users if the currently logged in $user doesn't have a certain role, and a different set of users if the currently logged in $user does have that role. How can I do this?
Comments
Comment #1
merlinofchaos commentedAssuming this is a page view, you can provide two displays with the same path. Make the first display(Higher in the tabs list) the more restricted view and use the access settings to restrict it to the role you need. Make the second view less restricted and have them each display what you need.
Comment #2
jim0203 commentedThanks for the idea, but it doesn't seem to work for my purposes. To provide a little more detail, what I'm doing is building a view and then displaying it in a CCK User Reference field. When normal users create a node that includes this field, I want the list to only show users with a certain role. When an administrator creates a node that includes this field, I want the list to show all users. Is this possible? Apologies for not being entirely clear first time round.
Comment #3
merlinofchaos commentedHm. CCK would need a way to choose multiple displays from the view, not just one. I can't think of a way to do this, currently.
Comment #4
jim0203 commentedOK, will take it up in the CCK issue queue. Thanks for your quick responses.
Comment #5
jim0203 commentedAfter digging around for a little while I've come across http://drupal.org/project/viewsphpfilter, which I think will do the job in my case - seems pretty flexible, too.