Ignore:
Timestamp:
2014-05-12T14:11:08+12:00 (10 years ago)
Author:
kjdon
Message:

allow an exception with no sets for document level security. This can be used to set the group for all docs when default access is private

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java

    r28984 r29049  
    512512            {
    513513                boolean inSet = false;
    514                 for (HashMap<String, ArrayList<String>> exception : _securityExceptions)
    515                 {
    516                     for (String setName : exception.get("sets"))
     514                for (HashMap<String, ArrayList<String>> exception : _securityExceptions) {
     515                 
     516                  ArrayList<String> exceptionSets = exception.get("sets");
     517                   if (exceptionSets.size() == 0) {
     518                    inSet = true;
     519                    for (String group : exception.get("groups"))
     520                      {
     521                    groups.add(group);
     522                      }
     523                   }
     524                   else {
     525                      for (String setName : exception.get("sets"))
    517526                    {
    518                         if (documentIsInSet(oid, setName))
     527                      if (documentIsInSet(oid, setName))
     528                        {
     529                          inSet = true;
     530                          for (String group : exception.get("groups"))
    519531                        {
    520                             inSet = true;
    521                             for (String group : exception.get("groups"))
    522                             {
    523                                 groups.add(group);
    524                             }
     532                          groups.add(group);
    525533                        }
     534                          break;
     535                        }
    526536                    }
    527                 }
    528 
     537                   }
     538                }
     539           
     540           
     541                 
    529542                if (!inSet && _publicAccess)
    530                 {
     543                  {// our doc was not part of any exception, so it must be public
    531544                    groups.add("");
    532545                }
    533546            }
    534             else
     547            else // if we are not doing a request with an oid, then free to access
    535548            {
    536549                groups.add("");
Note: See TracChangeset for help on using the changeset viewer.