Skip to content

Restrict dataset management to owners - #106

Open
juanNH wants to merge 1 commit into
devfrom
fix/dataset-user-rol
Open

Restrict dataset management to owners#106
juanNH wants to merge 1 commit into
devfrom
fix/dataset-user-rol

Conversation

@juanNH

@juanNH juanNH commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

/>
)
: '-'}
<TableCellWithTitle value={formatDateLocale(userFileRow.upload_date as string, 'L')} />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Si upload_date no es siempre string en vez de hacer un as hacer una condición ternaria. O editar el tipo para que siempre sea string (si no va a fallar)

size='large'
title={intl.formatMessage(
{ id: 'files.manager.tooltip.sharedWith' },
{ list: (this.state.sharedInstitutionsByFile[userFileRow.id as number] ?? userFileRow.institutions).map((i) => i.name).join(', ') }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ya lo ví varias veces en el código. Guardar this.state.sharedInstitutionsByFile[userFileRow.id as number] en una constante

Comment thread src/user_files/views.py
filter_condition = Q(is_public=True)
else:
# Gets UserFiles which belongs to current user
filter_condition = Q(user=user)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ya que está editando estos archivos, mover esta condición a un if/else:

# Gets UserFiles
if private_only:
    filter_condition = Q(user=user)
else:
    # Gets public and institutions datasets too
    filter_condition = user_file_visibility_q(user)

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