-
Notifications
You must be signed in to change notification settings - Fork 134
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
API and browse returns error message when there are private linked items #1507
Comments
Hmm, I don't think I've seen that error before from the forums. Is that full setup required for you to see this bug, or just the "A to B" part? Also, this sentence:
Is it supposed to be the other way around (i.e., things work as anonymous users when A is private, and they don't work when it's public)? Otherwise I have trouble squaring it with your initial description. My immediate attempt to reproduce the problem by just doing an "A to B" setup (a public item pointing to a private item) didn't have any results. My immediate suspicion is that this is related to a module. I do note that the "Next" module is included in your trace, and maybe it is related? You could try temporarily disabling it to see if it resolves the issue. |
I edited my issue to clarify. When A, B,C are all private. the API returns other public items. I tried deactivating everything, but still receive the same message. I hope I found a reproducible example: Experimenting with the issue I think it's connected to resource templates. I added a new object property (dct:contributor) to my resource template with data Type If I change to |
Okay, that's definitely relevant. There's code to handle this case of linking to private resources, but it's written to target specifically the type "resource," which is only the type of the regular "pick a kind" resource values, not the specific ones that you can set in the resource templates. Thanks to that extra bit of information, I can now reproduce the issue. |
The code preventing this kind of error was keyed specifically to the name "resource" for the data type of the value, but we've since introduced other more specific resource types for values that can point only to items, sets, etc. Rather than base this check on the name of the type, this instead checks if the type class extends from the abstract class for resource data types. This introduces a new method isHidden to the value representation to simplify this check. (fix #1507) (cherry picked from commit 61abd65)
The problem seems to be:
Public item A has an object property to private item B . Private items B and C has object properties to public item A. When I'm logged in as admin, browse works. When I use credentials in API, the API works. When I change item A from public to private, API and browse works without credentials.
I am unsure if this is an issue, or related to us testing Omeka-S with lots of modules installed.
Error message returned is:
See at https://birgitta.test.uib.no/api/items
Modules
System info
Edit: I wanted to first post at the community forum (forum.omeka.org), but I am unable to receive a confirmation/email registering.
Best regards,
Øyvind
The text was updated successfully, but these errors were encountered: