Authenticated user role not available as Views Filter criterion

Created on 16 April 2020, over 4 years ago
Updated 31 July 2023, over 1 year ago

I'm not sure if this is a views.module or user.module component issue but:
When a User entity reference field is added to a view and that field is added as a filter the Authenticated User role isn't available as a selection in the config Settings under Filter by: User Role.

πŸ› Bug report
Status

Postponed: needs info

Version

9.5

Component
ViewsΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia the_glitch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Might need some steps to reproduce here, I can't figure out how to get to these settings using the Authored by field or a custom User entity reference field.

    These settings are available when configuring the field itself in field UI though.

    Another question - what is the use case here? Isn't every user (except the one anonymous user which you can exclude by unticking the checkbox) an authenticated user?

  • πŸ‡¬πŸ‡§United Kingdom catch

    Isn't every user (except the one anonymous user which you can exclude by unticking the checkbox) an authenticated user?

    Yes I think this is 'works as designed'.

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Agreed

  • πŸ‡­πŸ‡ΊHungary djg_tram

    Yes, works as designed. The reason for it is the Roles.php filter that explicitly removes the authenticated user ID from the list.

    The solution is to use a grouped filter.

    Set Grouping 1 to Barefoot user and the operator to Only has the 'authenticated user' role. Set all the other groupings to your actual roles, that is, Grouping 2 will be named Role 1, operator is one of your Role 1. Grouping 3 will be named Role 2, operator is one of your Role 2, and so on.

    This way you will have a combobox with all your roles plus a simple user at the front.

Production build 0.71.5 2024