Add support for subordinate subtree to ACI.
| | |
| | | targetScope, targAttrFilters); |
| | | } |
| | | |
| | | /* |
| | | * TODO Add support for the SearchScope.SUBORDINATE_SUBTREE scope. |
| | | */ |
| | | /** |
| | | * Evaluates a provided scope string and returns an appropriate |
| | | * SearchScope enumeration. |
| | |
| | | return SearchScope.SINGLE_LEVEL; |
| | | else if(expression.equalsIgnoreCase("subtree")) |
| | | return SearchScope.WHOLE_SUBTREE; |
| | | else if(expression.equalsIgnoreCase("subordinate")) |
| | | return SearchScope.SUBORDINATE_SUBTREE; |
| | | else { |
| | | int msgID = |
| | | MSGID_ACI_SYNTAX_INVALID_TARGETSCOPE_EXPRESSION; |
| | |
| | | if(!entryDN.isDescendantOf(targetDN)) |
| | | return false; |
| | | break; |
| | | /* |
| | | * TODO Add support for the SearchScope.SUBORDINATE_SUBTREE scope. |
| | | * |
| | | * The isTargetApplicable method doesn't account for the subordinate |
| | | * subtree search scope. |
| | | */ |
| | | case SUBORDINATE_SUBTREE: |
| | | if ((entryDN.getNumComponents() <= targetDN.getNumComponents()) || |
| | | !entryDN.isDescendantOf(targetDN)) { |
| | | return false; |
| | | } |
| | | break; |
| | | default: |
| | | return false; |
| | | } |
| | |
| | | DN parent=evalCtx.getClientDN().getParent(); |
| | | if((parent != null) && !parent.equals(urlDN)) |
| | | return EnumEvalResult.FALSE; |
| | | } else if(scope == SearchScope.SUBORDINATE_SUBTREE) { |
| | | DN userDN = evalCtx.getClientDN(); |
| | | if ((userDN.getNumComponents() <= urlDN.getNumComponents()) || |
| | | !userDN.isDescendantOf(urlDN)) { |
| | | return EnumEvalResult.FALSE; |
| | | } |
| | | } else { |
| | | if(!evalCtx.getClientDN().equals(urlDN)) |
| | | return EnumEvalResult.FALSE; |
| | |
| | | buildAciValue("name", "w/ targetScope", "targetScope", "base", "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ targetScope", "targetScope", "onelevel", "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ targetScope", "targetScope", "subtree", "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ targetScope", "targetScope", "subordinate", "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ !target", "target!=", LDAP_URL_OU_INNER, "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ 1 !targetattr", "targetattr!=", "cn", "allow (write)", BIND_RULE_USERDN_SELF), |
| | | buildAciValue("name", "w/ 2 !targetattr", "targetattr!=", "cn || sn", "allow (write)", BIND_RULE_USERDN_SELF), |