Skip to content

Dashboard: Channel selector menu and new channel creation page being shown to seller admin without any channel permissions #4056

@radhey-tr

Description

@radhey-tr

Describe the bug
For a seller admin who only belongs to one channel, once they log into the dashboard, their respective channel should automatically be selected for them. But currently after logging in as superadmin into the default channel, and then logging out and logging in as the seller admin, a black screen is shown with no channel selected. Once the correct channel is selected from the menu, then all the options in the side nav menu are being show. Seller admins and admins without channel permissions should not be able to see the channel selector menu on the dashboard, nor should they be able to create channels. But currently both of these are available to view for the seller admin since the channel selector menu is not hidden from them.

To Reproduce

  1. Add multivendor plugin to vendure
  2. Register a seller.
  3. Login as super admin.
  4. Logout
  5. Login as the registered seller admin
  6. You should be logging in into a screen with no nav options and blank metrics, with no channel selected.

Expected behavior
Channel selector menu, and add channel option should not be visible to the seller admin in the first place, as it is in admin UI. On logging in, their respective seller channel should automatically be selected. They should not be able to view the channel creation page.

Actual behavior
Logging in into the dashboard as a seller admin, shows no nav options and blank metrics, with no channel selection present. Once you select the right channel then things start working normally, but then the channel selector should not be visible to the seller admin in the first place. From the menu they are able to navigate to the channel creation page.

Screenshots/Videos
Blank page first encountered by the seller admin
Image

Seller admin being able/having to select the channel
Image

Dashboard working after seller admin channel being selected
Image

Image

Channel creation page being accessible to seller admin
Image

We can see that no channel permission are available to the seller admin.
Image

Environment (please complete the following information):

  • @vendure/core version: 3.5.1
  • Nodejs version: v20.19.5
  • Database (mysql/postgres etc): postgres
  • Operating System (Windows/macOS/Linux): MacOS
  • Browser (if applicable): Arc
  • Package manager (npm/yarn/pnpm): npm

Configuration
If relevant, share your Vendure configuration (remove sensitive data):

Workaround
There is a temporary workaround described in this thread to auto select the channel incase of the admin having only 1 channel associated with them: discord link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions