This is a very simple change which allows the user roles filter to have the operators 'is null' and 'is not null'.

Because the {users_roles} table doesn't store the authenticated user role, the result of these operators is that you can make lists of users that show:

- only users which have a role beyond 'authenticated user' (ie, 'is not null')
- only users which have only the 'authenticated user' role (ie, 'is null')

Neither of these are currently cleanly possible with Views -- you can select all roles and set to 'is one of' or 'is none of' but your views break when new roles are added to the site.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
429 bytes

Should apply all the way back to 6.x-2.x (which is what I'm still on for this project...)

dawehner’s picture

Here is a try to improve the label of these operators. This would definitive help to understand what these options mean in this case.

Yeah of this feature, i always wondered why this wasn't possible :)

joachim’s picture

Good idea.

Here's a reroll with the strings tweaked a bit for grammar :)

dawehner’s picture

Status: Needs review » Fixed

Thanks! Committed to all three branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.