-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(core): Refactor how permissions get serialized for sessions into using a new strategy #3222
Draft
DanielBiegler
wants to merge
10
commits into
vendure-ecommerce:master
Choose a base branch
from
DanielBiegler:feat/new-role-permission-strategy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat(core): Refactor how permissions get serialized for sessions into using a new strategy #3222
DanielBiegler
wants to merge
10
commits into
vendure-ecommerce:master
from
DanielBiegler:feat/new-role-permission-strategy
Conversation
This file contains 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
… using a new strategy
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Draykee
reviewed
Nov 21, 2024
Draykee
reviewed
Nov 21, 2024
packages/core/src/config/auth/channel-role-permission-resolver-strategy.ts
Show resolved
Hide resolved
Draykee
reviewed
Nov 21, 2024
…stand the overlap
Draykee
reviewed
Nov 25, 2024
import { UserChannelPermissions } from '../../service/helpers/utils/get-user-channels-permissions'; | ||
|
||
/** | ||
* @description TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**
* @description
* A RolePermissionResolverStrategy defines how role-based permissions for a user should be resolved.
* This strategy is used to determine the permissions assigned to a user based on their roles per channel.
*
* By default {@link DefaultRolePermissionResolverStrategy} is used. However, for more complex environments using
* multiple channels and roles {@link ChannelRolePermissionResolverStrategy} is recommended.
*
* :::info
*
* This is configured via the `authOptions.rolePermissionResolverStrategy` properties of your VendureConfig.
*
* :::
*
* @docsCategory auth
* @since 3.3.0
*/
…ResolverStrategy` We need UI for the selection of channels but for the POC it will simply assign the default channel. Also moved emitting of events to the end of admin-update function so that a failure from updating custom field relations doesnt lead to wrong behavior of event handlers.
Quality Gate failedFailed conditions |
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.
This is a proof of concept for #3095
Description
Since this is WIP and theres no UI updates, you gotta update your DB manually to use the new
ChannelRole
Entity by inserting rows.Breaking changes
Nothing should change with the default strategy but once you use the new strategy there is a breaking change. This makes this feature opt-in for people that are interested in multi-vendor setups.
Screenshots
You can add screenshots here if applicable.
ToDo
Checklist
📌 Always:
👍 Most of the time: