fix(permissions): restore visibility controls in Flowise canvas for admin users#1052
Merged
Conversation
useAuth0() from @auth0/auth0-react has no Auth0Provider in the Flowise UI component tree — only UserProvider from @auth0/nextjs-auth0/client is present. This caused useAuth0() to return undefined, making createPermissionManager receive an empty object, which disabled all visibility checkboxes for every user. Fix: read from Redux state.auth.user, which is populated by useAuth0Setup after /auth/me enrichment and contains the correct roles and permissions.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
The Flowise canvas (`packages/ui`) wraps its tree with `` from `@auth0/nextjs-auth0/client` — not `` from `@auth0/auth0-react`. Calling `useAuth0()` from the wrong package silently returns `{ user: undefined }` because no matching provider exists in the tree.
`createPermissionManager(undefined ?? {})` produces an empty permission set → `hasFeature('org:manage')` = false → `Organization` and `Browser Extension` visibility checkboxes permanently disabled for every user, including admins.
The correct source is `state.auth.user` from Redux, populated by `useAuth0Setup` after fetching `/auth/me` and dispatching `loginSuccess`. This object contains server-enriched `roles` and `permissions` and is backed by `localStorage` for instant availability on returning sessions.
This fix also covers agentflows — both canvases share the same `CanvasHeader` → `ChatflowConfigurationDialog` → `VisibilitySettings` → `usePermissions` path.
Changes
Test plan
🤖 Generated with Claude Code