Changeset 29310


Ignore:
Timestamp:
2014-09-18T12:47:48+12:00 (10 years ago)
Author:
kjdon
Message:

look for a disabled attribute for security block - easily turn off security for a collection. Used so we can put sample security statements in a config file without them being used. If the block is just commented out then GLI will delete it. If scope is collection, then ignore any exceptions which have document sets. otherwise, if have an exception with empty group name and a document set, and change the scope to colleciton, all will be visible as the empty group will be added to list of groups.

File:
1 edited

Legend:

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

    r29164 r29310  
    303303        }
    304304
     305        String disabled = securityBlock.getAttribute(GSXML.DISABLED_ATT);
     306        if (!disabled.equals("")) {
     307          // security block has been disabled.
     308          logger.warn("Security block has been disabled. Not implementing any security for collection "+this.cluster_name);
     309          return;
     310        }
    305311        String scope = securityBlock.getAttribute(GSXML.SCOPE_ATT);
    306312        String defaultAccess = securityBlock.getAttribute(GSXML.DEFAULT_ACCESS_ATT);
     
    374380                    exceptionSets.add(docSetName);
    375381                }
    376 
     382                if (_securityScopeCollection) {
     383                  // we don't add in any exceptions that have document sets
     384                  if (!exceptionSets.isEmpty()) {
     385                    continue;
     386                  }
     387                }
    377388                securityException.put("groups", exceptionGroups);
    378389                securityException.put("sets", exceptionSets);
Note: See TracChangeset for help on using the changeset viewer.