Changeset 32459


Ignore:
Timestamp:
09/17/18 14:36:11 (3 years ago)
Author:
kjdon
Message:

added groupsContain method - can't just use a string contains as e.g. if the current coll is mgppdemo, and user is in gs2mgppdemo-collection-editor group, then the groups line would match with mgppdemo-collection-editor. so need to split teh string, and test each value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r31891 r32459  
    113113    }
    114114
     115  public static boolean groupsContains(String user_groups, String this_group)
     116  {
     117    String[] groups_array = user_groups.split(",");
     118    for (int i=0; i<groups_array.length; i++) {
     119      if (groups_array[i].equals(this_group)) {
     120    return true;
     121      }
     122    }
     123    return false;
     124
     125  }
    115126    public static boolean oidIsMatchOrParent(String first, String second)
    116127    {
Note: See TracChangeset for help on using the changeset viewer.