Skip to content

[5.x]: Global set shows Multi-Site dropdown with sites that user is not allowed to see. #15524

@ItsLucasYeah

Description

@ItsLucasYeah

What happened?

Description

Global set shows Multi-Site dropdown with sites that user is not allowed to see.
However when you click on a site that the user is not allowed to see, it won't switch, so it is only the listing of sites.

Steps to reproduce

  1. Create two sites (/admin/settings/sites) with both there own base url
  2. Create a global set, for example 'profile', with a basic text field. Set this basic text field to be translated per site.
  3. Create a second user who is not admin
  4. Assign permission to this second user to only edit the first site
  5. Assign permission to this second user to be able to edit the global set 'profile'.
  6. Now log in as the user, go to Globals and see the dropdown at the top with multiple site.

Expected behavior

See only the sites that the user is allowed to edit in the dropdown, or not show the dropdown at all when there is only one site they can edit.

It does work when you for example look at the entries page. There you have the same dropdown but only the sites that you are allowed to edit are listed

Actual behavior

The dropdown shows all sites, even sites that the user is not allowed to edit.

Screenshots

Scherm­afbeelding 2024-08-13 om 10 17 33
Scherm­afbeelding 2024-08-13 om 10 37 41

Craft CMS version

Craft Pro 5.3.1

PHP version

8.3.9

Operating system and version

MacOS Sonoma 14.3, Darwin 23.3.0

Database type and version

MySQL 8.0.35

Image driver and version

GD 8.3.9

Installed plugins and versions

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions