WebSearch: better restricted collection search
- Improves restricted collection handling by automatically showing restricted collections that are accessible to the user. Covers the following cases:
- a record belongs to a restricted collection and to other public collections.
- a record belongs to different restricted collections.
- search results belong to different restricted collections (user has rights or not) and to public collections.
- search restricted results belong to collections that not are daughter of the collection from which the user started his/her search.
- display results in the right position in the collection tree. (closes #1161)
- Adds new restricted collections in demo collection tree, and inserts records from CDS into these collections: Articles & Prepints -> Drafts (restricted) Articles & Preprints -> Notes ALEPH -> ALEPH Papers ALEPH -> ALEPH Theses (restricted) ALEPH -> ALEPH Internal Notes (restricted) ISOLDE -> ISOLDE Papers ISOLDE -> ISOLDE Internal Notes (hidden and restricted)
- Sets up new demo roles: thesesviewer -> jekyll@cds.cern.ch ALEPHviewer -> balthasar.montague@cds.cern.ch ISOLDEnotesviewer -> dorian.gray@cds.cern.ch
- Removes the config variable CFG_WEBSEARCH_PERMITTED_RESTRICTED_COLLECTIONS_LEVEL everywhere.
- Implements the "hidden" collection handling:
- If a user has rights to see a restricted and "hidden" collection, the following warning will be displayed: "If you were looking for a hidden document, please type the correct URL for this record".
- If a user not has rights, the following warning will be displayed: "If you were looking for a non-public document, please choose the desired restricted collection first", without mention that this record belongs to a "hidden" collection.
- If a user types the URL of a "hidden" record, and he/she has rights, the record will be displayed, otherwise is redirected to the login-page.
- Writes regression tests in a new class called "WebSearchRestrictedCollectionHandlingTest".
- Adds python regression tests to the class "WebSearchSearchEngineWebAPITest".
- Amends test cases for the other modules according to newly added test records.
Co-authored-by: Tibor Simko <tibor.simko@cern.ch>