I am still looking for some advice on this question.  I appreciate any
advice that you can offer.

The MoreLikeThis feature will return items that are inaccessible to
anonymous users.  Has anyone else encountered this issue?

If I have an instance of a DSpaceItem, what methods can I call to determine
if that object is accessible to anonymous users?

Thanks, Terry


On Wed, Aug 6, 2014 at 3:48 PM, Terry Brady <[email protected]>
wrote:

> I would like to restrict MoreLikeThis results to only include items with
> anonymous access.
>
> In order to do this, I believe that I will need to modify
> org.dspace.discovery.SolrServiceImpl.getRelatedItems()
>
> I have attempted to supply additional parameters to the solr query to
> return only items with a read group of "g0", but I have not had success.
>
> As a secondary option, I would like to check the accessibility of results.
>
>             NamedList mltResults = (NamedList)
> rsp.getResponse().get("moreLikeThis");
>             if(mltResults != null && mltResults.get(item.getType() + "-" +
> item.getID()) != null)
>             {
>                 SolrDocumentList relatedDocs = (SolrDocumentList)
> mltResults.get(item.getType() + "-" + item.getID());
>                 for (Object relatedDoc : relatedDocs)
>                 {
>                     SolrDocument relatedDocument = (SolrDocument)
> relatedDoc;
>                     DSpaceObject relatedItem = findDSpaceObject(context,
> relatedDocument);
>                     if (relatedItem.getType() == Constants.ITEM)
>                     {
>                         results.add((Item) relatedItem);
>                     }
>                 }
>             }
>
>
> What is the proper way to check if a DSpace Item is accessible to
> anonymous?
>
> --
> Terry Brady
> Applications Programmer Analyst
> Georgetown University Library Information Technology
> https://www.library.georgetown.edu/lit/code
> 425-298-5498
>



-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://www.library.georgetown.edu/lit/code
425-298-5498
------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to