-
Notifications
You must be signed in to change notification settings - Fork 0
fix: removed user membership access filter based on current user memb… #29
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,7 +154,7 @@ export default defineComponent({ | |
| this.buildGraph(entity.data) | ||
| this.members = _.orderBy(members.data, ['user.firstName', 'user.lastName'], ['asc']) | ||
| this.users = this.createUsers(users.data, this.members) | ||
| this.memberships = this.createMemberships(memberships.data) | ||
| this.memberships = memberships.data | ||
| this.inviteForm.membershipUuid = _.get(this.memberships, '0.uuid') | ||
| this.breadcrumbs = this.config.createBreadcrumbsWithSelf(meta.data.path, this.subject) | ||
| this.status.setDone() | ||
|
|
@@ -183,9 +183,6 @@ export default defineComponent({ | |
| fullName: `${u.firstName} ${u.lastName}`, | ||
| })), ['firstName', 'lastName'], ['asc']) | ||
| }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks too broad. The current code filters memberships by allowedEntities, and the backend still returns that field with entity-specific values. With the local API, Data Provider is only allowed for Catalog, but this PR would also show it for Dataset, Distribution, and Data Service. So this removes a real guard rather than fixing the underlying issue. Can we confirm whether allowedEntities is still authoritative before merging this? Suggestion: |
||
| createMemberships(memberships: Array<any>): Array<any> { | ||
| return memberships.filter((m) => _.includes(m.allowedEntities, this.config.uuid)) | ||
| }, | ||
| async submitInvite(): Promise<void> { | ||
| if (this.inviteForm.userUuid !== null && this.inviteForm.membershipUuid !== null) { | ||
| try { | ||
|
|
||
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.
🚨 question (security): Dropping the
allowedEntitiesfilter changes which memberships are available and may widen access scope.createMembershipspreviously limitedthis.membershipsto entries whoseallowedEntitiesincludedthis.config.uuid. Usingmemberships.datadirectly means the UI (and defaultinviteForm.membershipUuid) may now surface memberships for other entities. Unless the backend enforces the same entity constraint, this could allow invites with unintended memberships. If expanding scope is intentional, can you confirm the server is enforcing the necessary entity-level checks so the client-side filter is truly redundant?