while(fieldsIt.hasNext()) { field = (Field)fieldsIt.next(); if(field.getType().equals(FieldType.LIST)&& !"members".equals(field.getName())) { if(canRead(s,field,g)) { lists.add(field.getName());
/** * convert a fieldTypeName into a FieldType * @param fieldTypeName name of fieldType e.g. list (default, memberships), * access (privs on groups), attribute_def (privs on attribute definitions), naming (privs on folders) * @return the fieldType, or throw invalid query exception, or null if not there */ public static FieldType retrieveFieldType(String fieldTypeName) { FieldType fieldType = null; if (StringUtils.isBlank(fieldTypeName)) { return null; } //get field try { fieldType = StringUtils.isBlank(fieldTypeName) ? null : FieldType.valueOfIgnoreCase(fieldTypeName, true); } catch (Exception e) { throw new WsInvalidQueryException("Problem with fieldType: " + fieldTypeName + ". " + ExceptionUtils.getFullStackTrace(e)); } return fieldType; }
Field listField = membership.getList(); FieldType listFieldType = listField == null ? null : listField.getType(); this.setListType(listFieldType == null ? null : listFieldType.toString()); this.setListName(listField == null ? null : listField.getName()); if (membership.isImmediate()) {
/** * Construct a representation of an {@link Privilege} attribute. * * @see edu.internet2.middleware.grouper.shibboleth.dataConnector.field.BaseField#constructor(String id) * * @param id * the identifier * @param accessResolver * the access resolver * @throws GrouperException * */ public PrivilegeField(String id, AccessResolver accessResolver) throws GrouperException { super(id); this.accessResolver = accessResolver; try { Field field = FieldFinder.find(id, true); if (!field.getType().equals(FieldType.ACCESS)) { throw new GrouperException("Field '" + id + "' is not an access privilege"); } privilege = AccessPrivilege.listToPriv(id); if (privilege == null) { throw new GrouperException("Unknown access privilege '" + id + "'"); } } catch (SchemaException e) { throw new GrouperException("Unknown field '" + id + "'", e); } }