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.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1427252-3.views_.user-roles-allow-empty.patch | 1.23 KB | joachim |
#2 | 1427252.views_.user-roles-allow-empty.patch | 1.11 KB | dawehner |
#1 | 1427252.views_.user-roles-allow-empty.patch | 429 bytes | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedShould apply all the way back to 6.x-2.x (which is what I'm still on for this project...)
Comment #2
dawehnerHere 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 :)
Comment #3
joachim CreditAttribution: joachim commentedGood idea.
Here's a reroll with the strings tweaked a bit for grammar :)
Comment #4
dawehnerThanks! Committed to all three branches.