Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/components/EntitySettings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 question (security): Dropping the allowedEntities filter changes which memberships are available and may widen access scope.

createMemberships previously limited this.memberships to entries whose allowedEntities included this.config.uuid. Using memberships.data directly means the UI (and default inviteForm.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?

this.inviteForm.membershipUuid = _.get(this.memberships, '0.uuid')
this.breadcrumbs = this.config.createBreadcrumbsWithSelf(meta.data.path, this.subject)
this.status.setDone()
Expand Down Expand Up @@ -183,9 +183,6 @@ export default defineComponent({
fullName: `${u.firstName} ${u.lastName}`,
})), ['firstName', 'lastName'], ['asc'])
},
Copy link
Copy Markdown

@hcvdwerf hcvdwerf Apr 2, 2026

Choose a reason for hiding this comment

The 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:
this.memberships = memberships.data.filter((m) => !Array.isArray(m.allowedEntities) || m.allowedEntities.length === 0 || m.allowedEntities.includes(this.config.uuid) )

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 {
Expand Down