Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Hide /:teams EditorNavMenu from demoUser role #3911

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Nov 5, 2024

What?

Ensure demoUser role cannot view Team settings, team members, or team design pages.

Why?

Feedback from Show & Tell - users cannot use pages anyway, no benefit to showing them.

@DafyddLlyr DafyddLlyr changed the title fix: Hide /:teams EditorNavMenu from demoUser role fix: Hide /:teams EditorNavMenu from demoUser role Nov 5, 2024
@DafyddLlyr DafyddLlyr requested a review from a team November 5, 2024 11:11
@DafyddLlyr
Copy link
Contributor Author

Copy link

github-actions bot commented Nov 5, 2024

Removed vultr server and associated DNS entries

if (canUserEditTeam(teamSlug)) return accessibleBy.includes("teamEditor");
return accessibleBy.includes("teamViewer");
});
const visibleRoutes = routes.filter(({ accessibleBy }) => role && accessibleBy.includes(role));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is checking they can only see routes with "demoUser" in the accessibleBy rather than restricting the paths they shouldn't see?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right - this is just a visual control for the menu 👍

Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, I can't see any settings until I'm in a flow that I have created on the Demo team

@DafyddLlyr DafyddLlyr merged commit 042df8d into main Nov 5, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/hide-teams-menu-items-from-demoUser branch November 5, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants