Wang, Yongming wrote:
We've just upgraded our DSpace from 5.1 to 6.0. We want to restrict the bitstream access to one collection to campus only. I enabled the IPAuthentication statement in /dspace/config/modules

Now the problem is that we cannot access the bitstream both off-campus and on-campus. Every item's bitstream has a lock and either we have to login or access, or request a copy by filling in an

After so many failed tries, I start to suspect that it's a program bug, because it worked for our previous version (5.1).

Does anyone encounter such problem for DSpace 6.0? Is there any workaround to solve this issue?

Hello,

I have reproduced (and possibly fixed) DS-3463 in our 6.0 test installation. The following edit to org.dspace.eperson.GroupServiceImpl seems to fix it - at least with regard the IP-based access for anonymous users, but not extensively tested. Add

  List<Group> specialGroups = context.getSpecialGrocups();
  for(Group specialGroup : specialGroups) {
    if (StringUtils.equals(specialGroup.getName(), groupName)) {
      return true;
    }
  }

to the latter block of isMember(context,groupname) method in (just before return false in line 188):

https://github.com/DSpace/DSpace/blob/269af71afb602808a14edf822ad658c3895e0a37/dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java#L188

Rationale: download problem is the same regardless of the format used in configuration files (e.g. authentication.ip.GROUP or authentication-ip.GROUP) and the result is the same with Mirage or Mirage2 themes. While checking the log, it seems that IP authentication itself is working. While trying to download the file, messages like

DEBUG org.dspace.authenticate.IPAuthentication @ user@university:session_id=...:special_groups=GROUP, group id
DEBUG org.dspace.app.xmlui.utils.ContextUtil @ Adding Special Group id=GROUP

appear, but right after that the "Request copy of the document" pop up instead of the file, so this seems to be some kind of authorization/group membership checking issue. GroupService.isMember is called at least from AuthorizeServiceImpl.authorize while trying to download.

While tracking down the cause I noticed that somewhat similar authorization error appears also with REST API (i.e. if trying to retrieve a bitstream that is protected by IP-based special group) unauthenticated - but the above fix does not affect the REST case.


Best regards,
Miika Nurminen

--
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.

Reply via email to