Skip to content
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

Record Formatter previews not scoped #5061

Open
grantfitzsimmons opened this issue Jul 1, 2024 · 2 comments
Open

Record Formatter previews not scoped #5061

grantfitzsimmons opened this issue Jul 1, 2024 · 2 comments
Labels
1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources

Comments

@grantfitzsimmons
Copy link
Member

Describe the bug
Records from other collections appear in the record formatter previews, but they should only show results scoped to the logged-in collection and permission level of the current user.

To Reproduce
Steps to reproduce the behavior:

  1. Log into the nbm_mnb_2024_06_28 database as spadmin and log into the "Fish Voucher Collection"
  2. Go to https://nbmmnb20240628-edge.test.specifysystems.org/specify/resources/app-resource/13/formatter/Preparation/49 (Preparation Table Format)
  3. See the preview
  4. Note that preparation types that do not exist within the current collection appear in the preview, indicating that the preview is not scoped to preparations only present in the current collection

Expected behavior
The preview should be scoped correctly (within the current collection)

Screenshots
image

Voucher Collection:
image

Amphibian and Reptile Collection:
image

Crash Report
Specify 7 System Information - 2024-07-01T17_12_55.805Z.txt

Seems to be happening since v7.9.4 (when preview was introduced)

Observed by: New Brunswick Museum

@grantfitzsimmons grantfitzsimmons added 1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources labels Jul 1, 2024
@melton-jason
Copy link
Contributor

This behavior was intentional, and introduced by #4509.

There was an issue in that some tables can not be reliably scoped and thus would throw an error when trying to enforce scoping: #3564.

A more general approach to scoping can be used instead (see a usage of the implementation in #5044), but I agree with #5044 (review) in that the same logic should probably be utilized in the backend (instead of used in a myriad of places on the frontend).

@emenslin
Copy link
Collaborator

emenslin commented Aug 7, 2024

Can recreate in edge (7.9.6.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources
Projects
None yet
Development

No branches or pull requests

3 participants