public static Map hasAsMap(GrouperSession s, GroupOrStem groupOrStem, boolean isMortal) throws MemberNotFoundException{ Map privs = null;  Group g = null; Stem stem = null; boolean isActiveWheelGroupMember = Boolean.TRUE.equals(UIThreadLocal.get("isActiveWheelGroupMember")); privs = new HashMap(); if (!isMortal && ("GrouperSystem".equals(s.getSubject().getId()) || isActiveWheelGroupMember)) { privs.putAll(superPrivs); if(groupOrStem==null) return privs;  if (groupOrStem.isGroup()) { g = groupOrStem.getGroup();  if (g.hasMember(s.getSubject())) { privs.put("MEMBER", Boolean.TRUE); } } else { stem = groupOrStem.getStem(); } if (privs == null) privs = superPrivs; return privs; } if("GrouperSystem".equals(s.getSubject().getId()) ||isActiveWheelGroupMember) { privs = new HashMap(); privs.put("STEM",Boolean.TRUE); if(groupOrStem!=null && groupOrStem.isStem()&& !"".equals(groupOrStem.getStem().getName())) { privs.put("CREATE",Boolean.TRUE); } return privs; }  if(groupOrStem==null) return new HashMap();  g = groupOrStem.getGroup();  stem = groupOrStem.getStem();  Set privList = null; if (g != null) { privList = g.getPrivs(s.getSubject()); } else { privList = stem.getPrivs(s.getSubject()); } if(privList !=null) { Iterator it = privList.iterator(); Object p = null; while(it.hasNext()){ p=it.next(); if(p instanceof AccessPrivilege) { privs.put(((AccessPrivilege)p).getName().toUpperCase(), Boolean.TRUE); }else if(p instanceof NamingPrivilege) { privs.put(((NamingPrivilege)p).getName().toUpperCase(), Boolean.TRUE); }else{ privs.put(it.next(), Boolean.TRUE); } } } if (g != null) {  if (g.hasMember(s.getSubject())) privs.put("MEMBER", Boolean.TRUE); } return privs;
public static Map hasAsMap(GrouperSession s, GroupOrStem groupOrStem) throws MemberNotFoundException{ return hasAsMap(s, groupOrStem, false);
	public static Map hasAsMap(GrouperSession s, GroupOrStem groupOrStem,			boolean isMortal) throws MemberNotFoundException{		Map privs = null;		Group g = null;		Stem stem = null;		boolean isActiveWheelGroupMember = Boolean.TRUE.equals(UIThreadLocal.get("isActiveWheelGroupMember"));		privs = new HashMap();		if (!isMortal				&& ("GrouperSystem".equals(s.getSubject().getId())						|| isActiveWheelGroupMember)) {			privs.putAll(superPrivs);			if(groupOrStem==null) return privs;						if (groupOrStem.isGroup()) {				g = groupOrStem.getGroup();								if (g.hasMember(s.getSubject())) {					privs.put("MEMBER", Boolean.TRUE);				}			} else {				stem = groupOrStem.getStem();			}			if (privs == null)				privs = superPrivs;			return privs;		}		if("GrouperSystem".equals(s.getSubject().getId())				||isActiveWheelGroupMember) {			privs = new HashMap();			privs.put("STEM",Boolean.TRUE);			if(groupOrStem!=null && groupOrStem.isStem()&& !"".equals(groupOrStem.getStem().getName())) {				privs.put("CREATE",Boolean.TRUE);			}			return privs;		}				if(groupOrStem==null) return new HashMap();					g = groupOrStem.getGroup();					stem = groupOrStem.getStem();				Set privList = null;		if (g != null) {			privList = g.getPrivs(s.getSubject());		} else {			privList = stem.getPrivs(s.getSubject());		}		if(privList !=null) {			Iterator it = privList.iterator();			Object p = null;			while(it.hasNext()){				p=it.next();				if(p instanceof AccessPrivilege) {					privs.put(((AccessPrivilege)p).getName().toUpperCase(), Boolean.TRUE);				}else if(p instanceof NamingPrivilege) {					privs.put(((NamingPrivilege)p).getName().toUpperCase(), Boolean.TRUE);				}else{					privs.put(it.next(), Boolean.TRUE);				}			}		}		if (g != null) {						if (g.hasMember(s.getSubject()))				privs.put("MEMBER", Boolean.TRUE);		}		return privs;	}