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

Views not respecting embargo #16

Closed
seth-shaw-unlv opened this issue Feb 5, 2021 · 2 comments
Closed

Views not respecting embargo #16

seth-shaw-unlv opened this issue Feb 5, 2021 · 2 comments
Assignees

Comments

@seth-shaw-unlv
Copy link

I took an Islandora 1.1.0 image and created a collection with two items:
Screen Shot 2021-02-05 at 2 55 17 PM

I then embargoed one of the collection members: "Item One, to be embargoed":
Screen Shot 2021-02-05 at 2 56 19 PM

I then opened an incognito window to view the collection:
Screen Shot 2021-02-05 at 2 56 59 PM

Notice that it gives a some-what misleading message, because it seems to indicate the collection is under embargo, while only one object in the collection actually is. (Side-note: so we should probably use the node's title instead of "This resource".) You will also see that the teaser of the embargoed node is still shown in the members view.

Clicking on the embargoed node's link does direct us to an "access denied" page; although the node shouldn't have appeared in the first place:
Screen Shot 2021-02-05 at 2 57 25 PM

@seth-shaw-unlv
Copy link
Author

Clearing cache doesn't help.

I also checked the node_access table and the embargoed item isn't included:

mysql> select * from node_access;
+-----+----------+----------+-----+-------+------------+--------------+--------------+
| nid | langcode | fallback | gid | realm | grant_view | grant_update | grant_delete |
+-----+----------+----------+-----+-------+------------+--------------+--------------+
|   0 |          |        1 |   0 | all   |          1 |            0 |            0 |
+-----+----------+----------+-----+-------+------------+--------------+--------------+
1 row in set (0.00 sec)

Ah! from the Drupal API documentation for function hook_ENTITY_TYPE_access:

Note that this hook is not called for listings (e.g., from entity queries and Views). For nodes, see Node access rights for a full explanation. For other entity types, see hook_query_TAG_alter().

@jordandukart
Copy link

Fixed in #24.

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

No branches or pull requests

2 participants