Authenticated users get access denied

Created on 20 December 2024, 4 months ago

Problem/Motivation

Opening this as critical because it's extremely user-facing.

Steps to reproduce

As an admin user, create a new user account, don't assign any roles.

As the new user, log in.

After login, you get redirected to the dashboard, but you don't have access to it, so access denied.

Proposed resolution

Either give authenticated users dashboard access with a minimum selection of blocks, or redirect them to somewhere else?

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Component

Base Recipe

Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Merge Requests

Comments & Activities

  • Issue created by @catch
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I agree that this is both critical and stable-blocking.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    And it'll need test coverage.

  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Giving authenticated users access to the dashboard might be an issue as this is an admin page, uses the admin theme, and not every authenticated user may have access to the admin theme. As a result, the dashboard may look awkward.

    We discussed more fine-grained redirects depending upon role and/or permission before. But the dashboard module has the redirect hard-coded, and we can't make any changes, unless they agree to either remove that redirect or make it optional so that we could come up with smart redirects by turning the fixed redirect off.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I agree this needs to be fixed in Dashboard, it will be a problem on all sites, not just Drupal CMS.

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

    Let's move this to dashboard, should hopefully just be a permissions check before changing the redirect. Then we can see how that affects Drupal CMS specifically and whether auth users need a custom redirect or not.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I created an issue in Dashboard already, should have commented.

  • πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid

    Made some research and the issue is not related to the redirect itself, but the fact that dashboard module requires the 'access administration pages' permission globally to access to any dashboard.

    Given that 'access administration pages' permission is set at route level, it is not checked when checking dashboard entity access.

    At this point we need to decide whether we want to remove the 'access administration pages' permission for dashboards, or maintain the permission, but include it at entity level instead of route level.

  • πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid
  • πŸ‡ͺπŸ‡ΈSpain plopesc Valladolid

    It seems more logic to not require the access administration pages permission to access dashboards.
    Created MR for that approach to gain some time.

    However I would like to get input form other Dashboard folks before signing off the technical decision.

  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

    It seems more logic to not require the access administration pages permission to access dashboards.

    I agree with this. I could see the usecase of showing dashboards with the frontend theme as node edit does, eventually by using a setting.

    With this patch, if I don't have access to the admin theme, the frontend theme is used.

    I would be concerned about permissions, so checked this with a couple of blocks and the dashboard shows empty if I don't have the other necessary permissions for each block. E.g. don't see a content view if I don't have the required permissions for the view, etc.
    The theme used is the front-end one if I don't have the permissions to access the admin theme.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Looks like tests were written here.

  • Pipeline finished with Skipped
    4 months ago
    #376616
  • πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024