Fix using operational attributes in userattr bind rule keyword. Issue 1760.
| | |
| | | */ |
| | | private AttributeType attributeType; |
| | | |
| | | /* |
| | | * The attribute type string parsed from the rule. Only used in |
| | | * inheritance search. |
| | | */ |
| | | private String attrTypeStr; |
| | | |
| | | |
| | | /** |
| | | * Construct a class from the inheritance pattern. The skipParsing boolean |
| | |
| | | DirectoryServer.getAttributeType(toks[1])) == null) |
| | | this.attributeType = |
| | | DirectoryServer.getDefaultAttributeType(toks[1]); |
| | | attrTypeStr=toks[1]; |
| | | StringTokenizer tok=new StringTokenizer(toks[0],"],",false); |
| | | while(tok.hasMoreTokens()) { |
| | | String v=tok.nextToken(); |
| | |
| | | public AttributeType getAttributeType() { |
| | | return attributeType; |
| | | } |
| | | |
| | | /** |
| | | * Return the string representation of the attribute type. |
| | | * @return The attribute type string. |
| | | */ |
| | | public String getAttrTypeStr() { |
| | | return attrTypeStr; |
| | | } |
| | | } |
| | | |
| | |
| | | getDNParentLevel(levels[i], evalCtx.getResourceDN()); |
| | | if(pDN == null) |
| | | continue; |
| | | LinkedHashSet<String> reqAttrs = new LinkedHashSet<String>(1); |
| | | reqAttrs.add(parentInheritance.getAttrTypeStr()); |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | InternalSearchOperation op = conn.processSearch(pDN, |
| | | SearchScope.BASE_OBJECT, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, false, |
| | | filter, null); |
| | | filter, reqAttrs); |
| | | LinkedList<SearchResultEntry> result = |
| | | op.getSearchEntries(); |
| | | if (!result.isEmpty()) { |
| | | Entry e = result.getFirst(); |
| | | if (e.hasAttribute(attrType)) { |
| | | matched = evalEntryAttr(e, evalCtx, attrType); |
| | | if(matched.equals(EnumEvalResult.TRUE)) |
| | | stop=true; |
| | | } |
| | | } |
| | | } |
| | | } |