Just for clarifying, this is a DSpace 5 instance.
El martes, 14 de febrero de 2017, 11:00:24 (UTC-3), Patricio Marrone escribió: > > Hi all! > > We have a DSpace instance where admins have been marking elements as > private, expecting to protect them from unauthorized access. As far as I > understand, private items only marks them as non-discoverable, but makes > them accessible for anyone who has the item's link. This seems to include > Google crawlers and the like, which in this case is a problem. > > What I understand that needs to be done here is to find all items which > are marked as private and remove Anonymous read access (and add > Administrator ADMIN access, correct?). The advanced authorization > management page only seems to deal with collections, so I guess that I > should change this directly from the database. > > If anyone has some advice about this, it would be appreciated. > > I see some useful SQL scripts by Ivan Masár to get the policies for > bitstreams and items in > https://groups.google.com/d/msg/dspace-tech/WyMQkP-xmhk/PQ7tyl4EBwAJ > > So for bitstreams: >> >> SELECT * FROM resourcepolicy WHERE resource_type_id = '0' >> >> >> and for items (with item handle added): >> >> SELECT handle.handle, resourcepolicy.*FROM resourcepolicy, handleWHERE >> resourcepolicy.resource_type_id = '2'AND resourcepolicy.resource_id = >> handle.resource_id >> >> >> > And also this script from Peter Dietz to change access for Tiff bitsreams, > which seems close to what I am looking for (from > https://groups.google.com/d/msg/dspace-tech/gtlwKOaXoGc/Jegq67nABgAJ) > > You could write a SQL query to change the eperson_group with access from 0 >> to 1. (From anonymous to administrator group). >> The SELECT query to see what data your looking at: >> SELECT >> bitstream.bitstream_id, >> bitstream."name", >> bitstreamformatregistry.short_description, >> resourcepolicy.policy_id, >> resourcepolicy.action_id, >> resourcepolicy.eperson_id, >> resourcepolicy.epersongroup_id >> FROM >> public.bitstreamformatregistry, >> public.bitstream, >> public.resourcepolicy >> WHERE >> bitstream.bitstream_format_id = >> bitstreamformatregistry.bitstream_format_id AND >> resourcepolicy.resource_id = bitstream.bitstream_id AND >> bitstreamformatregistry.short_description = 'TIFF'; >> >> >> And the update query, that will actually change things. >> UPDATE >> resourcepolicy >> SET >> epersongroup_id=1 >> WHERE >> (policy_id IN( >> SELECT >> resourcepolicy.policy_id >> FROM >> public.bitstreamformatregistry, >> public.bitstream, >> public.resourcepolicy >> WHERE >> bitstream.bitstream_format_id = >> bitstreamformatregistry.bitstream_format_id AND >> resourcepolicy.resource_id = bitstream.bitstream_id AND >> bitstreamformatregistry.short_description = 'TIFF' >> )); >> > > > I'll try to derive a script for updating private items to Admin-only from > these posts. It would be helpful to know if someone has a better way to do > this or has already done this before. > > Thanks, > > - Patricio Marrone > -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
