blob: 9531e16d6bf063cc70ef898c3b919df640525ab1 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - com.google.enterprise.adaptor.Acl</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">146/146</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">3</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:97px"><span class="text">97/100</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$1</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">2/2</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$2</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">2/2</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$BatchRetriever</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$Builder</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">68/68</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">16/16</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$CaseInsensitiveCmp</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">1</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:90px"><span class="text">9/10</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">2/2</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$Decision</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">1</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:83px"><span class="text">5/6</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">1</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:75px"><span class="text">3/4</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$InheritanceType</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">9/9</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$InheritanceType$1</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">4/4</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">2/2</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$InheritanceType$2</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">4/4</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">2/2</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$InheritanceType$3</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">4/4</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">4/4</span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.Acl.html">Acl$InheritanceType$4</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">3/3</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">2.6666666666666665;</span>2.667</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr> <td class="numLine">&nbsp;1</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Copyright 2012 Google Inc. All Rights Reserved.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;2</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;3</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;4</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// you may not use this file except in compliance with the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;5</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// You may obtain a copy of the License at</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;6</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;7</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;8</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;9</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;10</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;11</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;12</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// See the License for the specific language governing permissions and</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;13</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// limitations under the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;14</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;15</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> com.google.enterprise.adaptor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;16</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;17</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.common.collect.Sets;</pre></td></tr>
<tr> <td class="numLine">&nbsp;18</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;19</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.IOException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;20</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td></tr>
<tr> <td class="numLine">&nbsp;21</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Arrays;</pre></td></tr>
<tr> <td class="numLine">&nbsp;22</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collection;</pre></td></tr>
<tr> <td class="numLine">&nbsp;23</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collections;</pre></td></tr>
<tr> <td class="numLine">&nbsp;24</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Comparator;</pre></td></tr>
<tr> <td class="numLine">&nbsp;25</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashMap;</pre></td></tr>
<tr> <td class="numLine">&nbsp;26</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashSet;</pre></td></tr>
<tr> <td class="numLine">&nbsp;27</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Locale;</pre></td></tr>
<tr> <td class="numLine">&nbsp;28</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.LinkedList;</pre></td></tr>
<tr> <td class="numLine">&nbsp;29</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td></tr>
<tr> <td class="numLine">&nbsp;30</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td></tr>
<tr> <td class="numLine">&nbsp;31</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Set;</pre></td></tr>
<tr> <td class="numLine">&nbsp;32</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.TreeSet;</pre></td></tr>
<tr> <td class="numLine">&nbsp;33</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.logging.Level;</pre></td></tr>
<tr> <td class="numLine">&nbsp;34</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.logging.Logger;</pre></td></tr>
<tr> <td class="numLine">&nbsp;35</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;36</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;37</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Immutable access control list. For description of the semantics of the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;38</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * various fields, see {@link #isAuthorizedLocal isAuthorizedLocal} and</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;39</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * {@link #isAuthorized isAuthorized}. Users and groups must not be {@code</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;40</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * null}, {@code ""}, or have surrounding whitespace. These values are</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;41</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * disallowed to prevent confusion since {@code null} doesn't make sense, {@code</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;42</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * ""} would be ignored by the GSA, and surrounding whitespace is automatically</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;43</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * trimmed by the GSA.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;44</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;45</td> <td class="nbHitsCovered">&nbsp;914</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> Acl {</pre></td></tr>
<tr> <td class="numLine">&nbsp;46</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;47</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Empty convenience instance with all defaults used.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;48</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;49</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see Builder#Acl.Builder()</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;50</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;51</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> Acl EMPTY = <span class="keyword">new</span> Acl.Builder().build();</pre></td></tr>
<tr> <td class="numLine">&nbsp;52</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;53</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * An almost-empty ACL that can be used instead of {@link #EMPTY} when sending</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;54</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * ACLs to the GSA. This allows the GSA to distinguish between an empty ACL</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;55</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * and a non-existant ACL.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;56</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;57</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">static</span> <span class="keyword">final</span> Acl FAKE_EMPTY = <span class="keyword">new</span> Acl.Builder()</pre></td></tr>
<tr> <td class="numLine">&nbsp;58</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; .setDenyUsers(Arrays.asList(</pre></td></tr>
<tr> <td class="numLine">&nbsp;59</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> UserPrincipal(<span class="string">"google:fakeUserToPreventMissingAcl"</span>)))</pre></td></tr>
<tr> <td class="numLine">&nbsp;60</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; .build();</pre></td></tr>
<tr> <td class="numLine">&nbsp;61</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;62</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Logger log = Logger.getLogger(Acl.<span class="keyword">class</span>.getName());</pre></td></tr>
<tr> <td class="numLine">&nbsp;63</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;64</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/** Locale used for case insensitivity related operations. */</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;65</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Locale CASE_LOCALE = Locale.ENGLISH;</pre></td></tr>
<tr> <td class="numLine">&nbsp;66</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;67</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Set&lt;GroupPrincipal&gt; permitGroups;</pre></td></tr>
<tr> <td class="numLine">&nbsp;68</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Set&lt;GroupPrincipal&gt; denyGroups;</pre></td></tr>
<tr> <td class="numLine">&nbsp;69</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Set&lt;UserPrincipal&gt; permitUsers;</pre></td></tr>
<tr> <td class="numLine">&nbsp;70</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Set&lt;UserPrincipal&gt; denyUsers;</pre></td></tr>
<tr> <td class="numLine">&nbsp;71</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> DocId inheritFrom;</pre></td></tr>
<tr> <td class="numLine">&nbsp;72</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> String inheritFromFragment;</pre></td></tr>
<tr> <td class="numLine">&nbsp;73</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> InheritanceType inheritType;</pre></td></tr>
<tr> <td class="numLine">&nbsp;74</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> <span class="keyword">boolean</span> caseSensitive;</pre></td></tr>
<tr> <td class="numLine">&nbsp;75</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;76</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> Acl(Set&lt;GroupPrincipal&gt; permitGroups, Set&lt;GroupPrincipal&gt; denyGroups,</pre></td></tr>
<tr> <td class="numLine">&nbsp;77</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; Set&lt;UserPrincipal&gt; permitUsers, Set&lt;UserPrincipal&gt; denyUsers,</pre></td></tr>
<tr> <td class="numLine">&nbsp;78</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; DocId inheritFrom, String inheritFromFragment,</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;79</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; InheritanceType inheritType, <span class="keyword">boolean</span> caseSensitive) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;80</td> <td class="nbHitsCovered"><a title="Line 80: Conditional coverage 100% (2/2).">&nbsp;151</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 80: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (!caseSensitive) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;81</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; permitGroups = Collections.unmodifiableSet(cmpWrap(permitGroups));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;82</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; denyGroups = Collections.unmodifiableSet(cmpWrap(denyGroups));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;83</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; permitUsers = Collections.unmodifiableSet(cmpWrap(permitUsers));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;84</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; denyUsers = Collections.unmodifiableSet(cmpWrap(denyUsers));</pre></td></tr>
<tr> <td class="numLine">&nbsp;85</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;86</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.permitGroups = permitGroups;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;87</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.denyGroups = denyGroups;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;88</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.permitUsers = permitUsers;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;89</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.denyUsers = denyUsers;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;90</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.inheritFrom = inheritFrom;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;91</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.inheritFromFragment = inheritFromFragment;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;92</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.inheritType = inheritType;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;93</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.caseSensitive = caseSensitive;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;94</td> <td class="nbHitsCovered">&nbsp;151</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;95</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;96</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> &lt;P <span class="keyword">extends</span> Principal&gt; Set&lt;P&gt; cmpWrap(Set&lt;P&gt; unwrapped) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;97</td> <td class="nbHitsCovered">&nbsp;90</td> <td class="src"><pre class="src">&nbsp; Set&lt;P&gt; tmp = <span class="keyword">new</span> TreeSet&lt;P&gt;(<span class="keyword">new</span> CaseInsensitiveCmp&lt;P&gt;());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;98</td> <td class="nbHitsCovered">&nbsp;90</td> <td class="src"><pre class="src">&nbsp; tmp.addAll(unwrapped);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;99</td> <td class="nbHitsCovered">&nbsp;90</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> tmp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;100</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;101</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;102</td> <td class="nbHitsCovered">&nbsp;413</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">class</span> CaseInsensitiveCmp&lt;P <span class="keyword">extends</span> Principal&gt;</pre></td></tr>
<tr> <td class="numLine">&nbsp;103</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">implements</span> Comparator&lt;P&gt; {</pre></td></tr>
<tr> <td class="numLine">&nbsp;104</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/** Does not differentiate between UserPrincipal and GroupPrincipal */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;105</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">int</span> compare(P p1, P p2) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;106</td> <td class="nbHitsCovered">&nbsp;233</td> <td class="src"><pre class="src">&nbsp; String ns1 = p1.getNamespace().toLowerCase(CASE_LOCALE);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;107</td> <td class="nbHitsCovered">&nbsp;233</td> <td class="src"><pre class="src">&nbsp; String ns2 = p2.getNamespace().toLowerCase(CASE_LOCALE);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;108</td> <td class="nbHitsCovered">&nbsp;233</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">int</span> nscmp = ns1.compareTo(ns2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;109</td> <td class="nbHitsCovered"><a title="Line 109: Conditional coverage 100% (2/2).">&nbsp;233</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 109: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (0 != nscmp) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;110</td> <td class="nbHitsCovered">&nbsp;96</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> nscmp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;111</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;112</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// OK, same namespace</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;113</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; </pre></td></tr>
<tr> <td class="numLineCover">&nbsp;114</td> <td class="nbHitsCovered">&nbsp;137</td> <td class="src"><pre class="src">&nbsp; String n1 = p1.getName().toLowerCase(CASE_LOCALE);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;115</td> <td class="nbHitsCovered">&nbsp;137</td> <td class="src"><pre class="src">&nbsp; String n2 = p2.getName().toLowerCase(CASE_LOCALE);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;116</td> <td class="nbHitsCovered">&nbsp;137</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> n1.compareTo(n2);</pre></td></tr>
<tr> <td class="numLine">&nbsp;117</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;118</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;119</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">boolean</span> equals(Object o) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;120</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">return</span> o <span class="keyword">instanceof</span> CaseInsensitiveCmp;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;121</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;122</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;123</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;124</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;125</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of permitted groups.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;126</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;127</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;GroupPrincipal&gt; getPermitGroups() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;128</td> <td class="nbHitsCovered">&nbsp;72</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> permitGroups;</pre></td></tr>
<tr> <td class="numLine">&nbsp;129</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;130</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;131</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;132</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of denied groups.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;133</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;134</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;GroupPrincipal&gt; getDenyGroups() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;135</td> <td class="nbHitsCovered">&nbsp;70</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> denyGroups;</pre></td></tr>
<tr> <td class="numLine">&nbsp;136</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;137</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;138</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;139</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of permitted users.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;140</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;141</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;UserPrincipal&gt; getPermitUsers() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;142</td> <td class="nbHitsCovered">&nbsp;73</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> permitUsers;</pre></td></tr>
<tr> <td class="numLine">&nbsp;143</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;144</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;145</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;146</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of denied users.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;147</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;148</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;UserPrincipal&gt; getDenyUsers() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;149</td> <td class="nbHitsCovered">&nbsp;71</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> denyUsers;</pre></td></tr>
<tr> <td class="numLine">&nbsp;150</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;151</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;152</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;153</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of permitted users and groups.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;154</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;155</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;Principal&gt; getPermits() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;156</td> <td class="nbHitsCovered">&nbsp;8</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> Sets.union(permitUsers, permitGroups);</pre></td></tr>
<tr> <td class="numLine">&nbsp;157</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;158</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;159</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;160</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns immutable set of denied users and groups;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;161</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;162</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> Set&lt;Principal&gt; getDenies() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;163</td> <td class="nbHitsCovered">&nbsp;8</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> Sets.union(denyUsers, denyGroups);</pre></td></tr>
<tr> <td class="numLine">&nbsp;164</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;165</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;166</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;167</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns {@code DocId} these ACLs are inherited from. This is also known as</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;168</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * the "parent's" ACLs. Note that the parent's {@code InheritanceType}</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;169</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * determines how to combine results with this ACL.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;170</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;171</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see #getInheritanceType</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;172</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;173</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> DocId getInheritFrom() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;174</td> <td class="nbHitsCovered">&nbsp;266</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> inheritFrom;</pre></td></tr>
<tr> <td class="numLine">&nbsp;175</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;176</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;177</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;178</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns fragment, if there is one, that specifies which of the parent's</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;179</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * ACLs is to to be inhertied from.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;180</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;181</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see #getInheritanceType</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;182</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;183</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> String getInheritFromFragment() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;184</td> <td class="nbHitsCovered">&nbsp;54</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> inheritFromFragment;</pre></td></tr>
<tr> <td class="numLine">&nbsp;185</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;186</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;187</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;188</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns the inheritance type used to combine authz decisions of these ACLs</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;189</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * with its &lt;em&gt;child&lt;/em&gt;. The inheritance type applies to the interaction</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;190</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * between this ACL and any &lt;em&gt;children&lt;/em&gt; it has.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;191</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;192</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see #getInheritFrom</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;193</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;194</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> InheritanceType getInheritanceType() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;195</td> <td class="nbHitsCovered">&nbsp;129</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> inheritType;</pre></td></tr>
<tr> <td class="numLine">&nbsp;196</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;197</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;198</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;199</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Says whether letter casing differentiates names during authorization.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;200</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;201</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">boolean</span> isEverythingCaseSensitive() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;202</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> caseSensitive;</pre></td></tr>
<tr> <td class="numLine">&nbsp;203</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;204</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;205</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;206</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Says whether letter casing doesn't matter during authorization.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;207</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;208</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">boolean</span> isEverythingCaseInsensitive() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;209</td> <td class="nbHitsCovered"><a title="Line 209: Conditional coverage 100% (2/2).">&nbsp;8</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 209: Conditional coverage 100% (2/2)."> <span class="keyword">return</span> !caseSensitive;</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;210</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;211</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;212</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;213</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Determine if the provided {@code userIdentifier} belonging to {@code</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;214</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * groups} is authorized, ignoring inheritance. Deny trumps permit,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;215</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * independent of how specific the rule is. So if a user is in permitUsers and</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;216</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * one of the user's groups is in denyGroups, that user will be denied. If a</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;217</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * user and his groups are unspecified in the ACL, then the response is</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;218</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * indeterminate.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;219</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;220</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> AuthzStatus isAuthorizedLocal(AuthnIdentity userIdentity) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;221</td> <td class="nbHitsCovered">&nbsp;57</td> <td class="src"><pre class="src">&nbsp; UserPrincipal userIdentifier = userIdentity.getUser();</pre></td></tr>
<tr> <td class="numLine">&nbsp;222</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; Set&lt;GroupPrincipal&gt; commonGroups;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;223</td> <td class="nbHitsCovered"><a title="Line 223: Conditional coverage 100% (2/2).">&nbsp;57</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 223: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (caseSensitive) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;224</td> <td class="nbHitsCovered">&nbsp;54</td> <td class="src"><pre class="src">&nbsp; commonGroups = <span class="keyword">new</span> HashSet&lt;GroupPrincipal&gt;(denyGroups);</pre></td></tr>
<tr> <td class="numLine">&nbsp;225</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;226</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; commonGroups = cmpWrap(denyGroups);</pre></td></tr>
<tr> <td class="numLine">&nbsp;227</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;228</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;229</td> <td class="nbHitsCovered">&nbsp;57</td> <td class="src"><pre class="src">&nbsp; Set&lt;GroupPrincipal&gt; userGroups = userIdentity.getGroups();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;230</td> <td class="nbHitsCovered"><a title="Line 230: Conditional coverage 100% (2/2).">&nbsp;57</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 230: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (!caseSensitive) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;231</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; userGroups = Collections.unmodifiableSet(cmpWrap(userGroups));</pre></td></tr>
<tr> <td class="numLine">&nbsp;232</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;233</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;234</td> <td class="nbHitsCovered">&nbsp;57</td> <td class="src"><pre class="src">&nbsp; commonGroups.retainAll(userGroups);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;235</td> <td class="nbHitsCovered"><a title="Line 235: Conditional coverage 100% (4/4) [each condition: 100%, 100%].">&nbsp;57</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 235: Conditional coverage 100% (4/4) [each condition: 100%, 100%]."> <span class="keyword">if</span> (denyUsers.contains(userIdentifier) || !commonGroups.isEmpty()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;236</td> <td class="nbHitsCovered">&nbsp;17</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> AuthzStatus.DENY;</pre></td></tr>
<tr> <td class="numLine">&nbsp;237</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;238</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;239</td> <td class="nbHitsCovered">&nbsp;40</td> <td class="src"><pre class="src">&nbsp; commonGroups.clear();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;240</td> <td class="nbHitsCovered">&nbsp;40</td> <td class="src"><pre class="src">&nbsp; commonGroups.addAll(permitGroups);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;241</td> <td class="nbHitsCovered">&nbsp;40</td> <td class="src"><pre class="src">&nbsp; commonGroups.retainAll(userGroups);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;242</td> <td class="nbHitsCovered"><a title="Line 242: Conditional coverage 100% (4/4) [each condition: 100%, 100%].">&nbsp;40</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 242: Conditional coverage 100% (4/4) [each condition: 100%, 100%]."> <span class="keyword">if</span> (permitUsers.contains(userIdentifier) || !commonGroups.isEmpty()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;243</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> AuthzStatus.PERMIT;</pre></td></tr>
<tr> <td class="numLine">&nbsp;244</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;245</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;246</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> AuthzStatus.INDETERMINATE;</pre></td></tr>
<tr> <td class="numLine">&nbsp;247</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;248</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;249</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;250</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Determine if the provided {@code userIdentity} belonging to {@code</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;251</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * groups} is authorized for the provided {@code aclChain}. The chain should</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;252</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * be in order of root to leaf; that means that the particular file or folder</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;253</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * you are checking for authz will be at the end of the chain.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;254</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;255</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;If you have an ACL and wish to determine if a user is authorized, you</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;256</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * should manually generate an aclChain by recursively retrieving the ACLs of</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;257</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * the {@code inheritFrom} {@link DocId}. The ACL you started with should be</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;258</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * at the end of the chain. Alternatively, you can use {@link</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;259</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * #isAuthorizedBatch isAuthorizedBatch()}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;260</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;261</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;If the entire chain has empty permit/deny sets, then the result is</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;262</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * {@link AuthzStatus#INDETERMINATE}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;263</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;264</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;The result of the entire chain is the non-local decision of the root.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;265</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * The non-local decision of any entry in the chain is the local decision of</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;266</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * that entry (as calculated with {@link #isAuthorizedLocal</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;267</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * isAuthorizedLocal()}) combined with the non-local decision of the next</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;268</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * entry in the chain via the {@code InheritanceType} of the original entry.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;269</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * To repeat, the non-local decision of an entry is that entry's local</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;270</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * decision combined using its {@code InheritanceType} with its child's</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;271</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * non-local decision (which is recursive). Thus, if the root's inheritance</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;272</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * type is {@link InheritanceType#PARENT_OVERRIDES} and its local decision is</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;273</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * {@link AuthzStatus#DENY}, then independent of any decendant's local</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;274</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * decision, the decision of the chain will be {@code DENY}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;275</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;276</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;It should also be noted that the leaf's inheritance type does not matter</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;277</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * and is ignored.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;278</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;279</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;It is very important to note that a completely empty ACL (one that has</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;280</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * all defaults) is equivalent to having no ACLs. The GSA considers content</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;281</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * from the Adaptor as public unless it provides an ACL. Thus, empty ACLs</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;282</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * cause a document to become public and the GSA does not use ACLs when</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;283</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * considering public documents (and all results are PERMIT). However, for</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;284</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * non-Adaptor situations, you can get a document to be private and have no</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;285</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * ACLs. In these situations the ACLs are checked, but the result is</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;286</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * INDETERMINATE and different authz checks must be made.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;287</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;288</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param userIdentity identity containing the user's username and all the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;289</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * groups the user belongs to</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;290</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param aclChain ordered list of ACLs from root to leaf</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;291</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IllegalArgumentException if the chain is empty, the first element</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;292</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * of the chain's {@code getInheritFrom() != null}, or if any element but</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;293</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * the first has {@code getInheritFrom() == null}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;294</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see #isAuthorizedLocal</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;295</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see InheritanceType</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;296</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;297</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">static</span> AuthzStatus isAuthorized(AuthnIdentity userIdentity,</pre></td></tr>
<tr> <td class="numLine">&nbsp;298</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; List&lt;Acl&gt; aclChain) {</pre></td></tr>
<tr> <td class="numLine">&nbsp;299</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Check for completely broken chains. Users of the API should be aware</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;300</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// enough to easily prevent these from happening. These also don't directly</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;301</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// relate to a case on the GSA because the GSA is working more on the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;302</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// isAuthorizedRecurse level.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;303</td> <td class="nbHitsCovered"><a title="Line 303: Conditional coverage 100% (2/2).">&nbsp;35</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 303: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.size() &lt; 1) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;304</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;305</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"aclChain must contain at least one ACL"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;306</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;307</td> <td class="nbHitsCovered"><a title="Line 307: Conditional coverage 100% (2/2).">&nbsp;34</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 307: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.get(0).getInheritFrom() != <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;308</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;309</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Chain must start at the root, which must not have an inheritFrom"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;310</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;311</td> <td class="nbHitsCovered"><a title="Line 311: Conditional coverage 100% (2/2).">&nbsp;60</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 311: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (<span class="keyword">int</span> i = 1; i &lt; aclChain.size(); i++) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;312</td> <td class="nbHitsCovered"><a title="Line 312: Conditional coverage 100% (2/2).">&nbsp;28</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 312: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.get(i).getInheritFrom() == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;313</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;314</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Each ACL in the chain except the first should have an "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;315</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"inheritFrom"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;316</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;317</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;318</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;319</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Check for broken chain constructions. These don't throw an exception to</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;320</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// 1) match the GSA's identical handling of these situations and 2) because</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;321</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// we don't want to throw an exception if the caller can't easily prevent</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;322</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// it from ever occuring.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;323</td> <td class="nbHitsCovered"><a title="Line 323: Conditional coverage 100% (2/2).">&nbsp;32</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 323: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.size() == 1) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;324</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; Acl acl = aclChain.get(0);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;325</td> <td class="nbHitsCovered"><a title="Line 325: Conditional coverage 100% (2/2).">&nbsp;15</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 325: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (acl.equals(EMPTY)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;326</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; log.log(Level.FINE, <span class="string">"Chain only has one ACL and it is empty. This "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;327</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"implies 'no ACLs.'"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;328</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> AuthzStatus.INDETERMINATE;</pre></td></tr>
<tr> <td class="numLine">&nbsp;329</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;330</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;331</td> <td class="nbHitsCovered"><a title="Line 331: Conditional coverage 100% (2/2).">&nbsp;55</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 331: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; aclChain.size() - 1; i++) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;332</td> <td class="nbHitsCovered"><a title="Line 332: Conditional coverage 100% (2/2).">&nbsp;26</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 332: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.get(i).getInheritanceType() == InheritanceType.LEAF_NODE) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;333</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Only the last ACL in a chain can have the "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;334</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"inheritance type LEAF"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;335</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> AuthzStatus.INDETERMINATE;</pre></td></tr>
<tr> <td class="numLine">&nbsp;336</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;337</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;338</td> <td class="nbHitsCovered">&nbsp;29</td> <td class="src"><pre class="src">&nbsp; AuthzStatus result = isAuthorizedRecurse(userIdentity, aclChain);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;339</td> <td class="nbHitsCovered"><a title="Line 339: Conditional coverage 100% (2/2).">&nbsp;29</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 339: Conditional coverage 100% (2/2)."> <span class="keyword">return</span> (result == AuthzStatus.INDETERMINATE) ? AuthzStatus.DENY : result;</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;340</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;341</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;342</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> AuthzStatus isAuthorizedRecurse(</pre></td></tr>
<tr> <td class="numLine">&nbsp;343</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">final</span> AuthnIdentity userIdentity, <span class="keyword">final</span> List&lt;Acl&gt; aclChain) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;344</td> <td class="nbHitsCovered"><a title="Line 344: Conditional coverage 100% (2/2).">&nbsp;43</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 344: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (aclChain.size() == 1) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;345</td> <td class="nbHitsCovered">&nbsp;24</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> aclChain.get(0).isAuthorizedLocal(userIdentity);</pre></td></tr>
<tr> <td class="numLine">&nbsp;346</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;347</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class="src">&nbsp; Decision parentDecision = <span class="keyword">new</span> Decision() {</pre></td></tr>
<tr> <td class="numLine">&nbsp;348</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @Override</pre></td></tr>
<tr> <td class="numLine">&nbsp;349</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">protected</span> AuthzStatus computeDecision() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;350</td> <td class="nbHitsCovered">&nbsp;16</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> aclChain.get(0).isAuthorizedLocal(userIdentity);</pre></td></tr>
<tr> <td class="numLine">&nbsp;351</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;352</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; };</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;353</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class="src">&nbsp; Decision childDecision = <span class="keyword">new</span> Decision() {</pre></td></tr>
<tr> <td class="numLine">&nbsp;354</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @Override</pre></td></tr>
<tr> <td class="numLine">&nbsp;355</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">protected</span> AuthzStatus computeDecision() {</pre></td></tr>
<tr> <td class="numLine">&nbsp;356</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Recurse.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;357</td> <td class="nbHitsCovered">&nbsp;14</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> isAuthorizedRecurse(userIdentity,</pre></td></tr>
<tr> <td class="numLine">&nbsp;358</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; aclChain.subList(1, aclChain.size()));</pre></td></tr>
<tr> <td class="numLine">&nbsp;359</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;360</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; };</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;361</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> aclChain.get(0).getInheritanceType()</pre></td></tr>
<tr> <td class="numLine">&nbsp;362</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; .isAuthorized(childDecision, parentDecision);</pre></td></tr>
<tr> <td class="numLine">&nbsp;363</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;364</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;365</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;366</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Check authz for many DocIds at once. This will only fetch ACL information</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;367</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * for a DocId once, even when considering inheritFrom. It will then create</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;368</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * the appropriate chains and call {@link #isAuthorized isAuthorized()}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;369</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;370</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;If there is an inheritance cycle, an ACL for a DocId in {@code ids} was</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;371</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * not returned by {@code retriever} when requested, or an inherited ACL was</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;372</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * not returned by {@code retriever} when requested, its response will be</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;373</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * {@link AuthzStatus#INDETERMINATE} for that DocId.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;374</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;375</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param userIdentity identity containing the user's username and all the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;376</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * groups the user belongs to</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;377</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param ids collection of DocIds that need authz performed</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;378</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @param retriever object to use to obtain an ACL for a given DocId</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;379</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @throws IOException if the retriever throws an IOException</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;380</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;381</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">static</span> Map&lt;DocId, AuthzStatus&gt; isAuthorizedBatch(</pre></td></tr>
<tr> <td class="numLine">&nbsp;382</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; AuthnIdentity userIdentity, Collection&lt;DocId&gt; ids,</pre></td></tr>
<tr> <td class="numLine">&nbsp;383</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; BatchRetriever retriever) <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;384</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Map&lt;DocId, Acl&gt; acls = retrieveNecessaryAcls(ids, retriever);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;385</td> <td class="nbHitsCovered">&nbsp;36</td> <td class="src"><pre class="src">&nbsp; Map&lt;DocId, AuthzStatus&gt; results</pre></td></tr>
<tr> <td class="numLine">&nbsp;386</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; = <span class="keyword">new</span> HashMap&lt;DocId, AuthzStatus&gt;(ids.size() * 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;387</td> <td class="nbHitsCovered"><a title="Line 387: Conditional coverage 100% (2/2).">&nbsp;36</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 387: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (DocId docId : ids) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;388</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; List&lt;Acl&gt; chain = createChain(docId, acls);</pre></td></tr>
<tr> <td class="numLine">&nbsp;389</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; AuthzStatus result;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;390</td> <td class="nbHitsCovered"><a title="Line 390: Conditional coverage 100% (2/2).">&nbsp;38</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 390: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (chain == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;391</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// There was a cycle or other problem generating the chain.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;392</td> <td class="nbHitsCovered">&nbsp;8</td> <td class="src"><pre class="src">&nbsp; result = AuthzStatus.INDETERMINATE;</pre></td></tr>
<tr> <td class="numLine">&nbsp;393</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;394</td> <td class="nbHitsCovered">&nbsp;30</td> <td class="src"><pre class="src">&nbsp; result = isAuthorized(userIdentity, chain);</pre></td></tr>
<tr> <td class="numLine">&nbsp;395</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;396</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; results.put(docId, result);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;397</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;398</td> <td class="nbHitsCovered">&nbsp;36</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> Collections.unmodifiableMap(results);</pre></td></tr>
<tr> <td class="numLine">&nbsp;399</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;400</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;401</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> Map&lt;DocId, Acl&gt; retrieveNecessaryAcls(Collection&lt;DocId&gt; ids,</pre></td></tr>
<tr> <td class="numLine">&nbsp;402</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; BatchRetriever retriever) <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;403</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Map&lt;DocId, Acl&gt; acls = <span class="keyword">new</span> HashMap&lt;DocId, Acl&gt;(ids.size() * 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;404</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Set&lt;DocId&gt; missingAcls = <span class="keyword">new</span> HashSet&lt;DocId&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;405</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Set&lt;DocId&gt; pendingRetrieval = <span class="keyword">new</span> HashSet&lt;DocId&gt;(ids);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;406</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Set&lt;Acl&gt; checkedAcl = <span class="keyword">new</span> HashSet&lt;Acl&gt;(ids.size() * 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;407</td> <td class="nbHitsCovered">&nbsp;37</td> <td class="src"><pre class="src">&nbsp; Set&lt;Acl&gt; toProcess = <span class="keyword">new</span> HashSet&lt;Acl&gt;(ids.size() * 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;408</td> <td class="nbHitsCovered"><a title="Line 408: Conditional coverage 100% (2/2).">&nbsp;102</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 408: Conditional coverage 100% (2/2)."> <span class="keyword">while</span> (!pendingRetrieval.isEmpty()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;409</td> <td class="nbHitsCovered">&nbsp;66</td> <td class="src"><pre class="src">&nbsp; Map&lt;DocId, Acl&gt; returned = retriever.retrieveAcls(pendingRetrieval);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;410</td> <td class="nbHitsCovered">&nbsp;66</td> <td class="src"><pre class="src">&nbsp; toProcess.clear();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;411</td> <td class="nbHitsCovered"><a title="Line 411: Conditional coverage 100% (2/2).">&nbsp;66</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 411: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (Map.Entry&lt;DocId, Acl&gt; me : returned.entrySet()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;412</td> <td class="nbHitsCovered"><a title="Line 412: Conditional coverage 100% (2/2).">&nbsp;67</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 412: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (me.getValue() == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;413</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;414</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"BatchRetriever returned null for a DocId"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;415</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;416</td> <td class="nbHitsCovered">&nbsp;66</td> <td class="src"><pre class="src">&nbsp; DocId key = me.getKey();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;417</td> <td class="nbHitsCovered"><a title="Line 417: Conditional coverage 100% (4/4) [each condition: 100%, 100%].">&nbsp;66</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 417: Conditional coverage 100% (4/4) [each condition: 100%, 100%]."> <span class="keyword">if</span> (acls.containsKey(key) || missingAcls.contains(key)) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;418</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Don't replace previous results since we have already checked them.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;419</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">continue</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;420</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;421</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; acls.put(key, me.getValue());</pre></td></tr>
<tr> <td class="numLine">&nbsp;422</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// If we requested this ACL, follow its inheritance.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;423</td> <td class="nbHitsCovered"><a title="Line 423: Conditional coverage 100% (2/2).">&nbsp;64</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 423: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (pendingRetrieval.contains(key)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;424</td> <td class="nbHitsCovered">&nbsp;63</td> <td class="src"><pre class="src">&nbsp; toProcess.add(me.getValue());</pre></td></tr>
<tr> <td class="numLine">&nbsp;425</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;426</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;427</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Compute ACLs that we requested, but did not receive.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;428</td> <td class="nbHitsCovered">&nbsp;65</td> <td class="src"><pre class="src">&nbsp; pendingRetrieval.removeAll(returned.keySet());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;429</td> <td class="nbHitsCovered">&nbsp;65</td> <td class="src"><pre class="src">&nbsp; missingAcls.addAll(pendingRetrieval);</pre></td></tr>
<tr> <td class="numLine">&nbsp;430</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;431</td> <td class="nbHitsCovered">&nbsp;65</td> <td class="src"><pre class="src">&nbsp; pendingRetrieval.clear();</pre></td></tr>
<tr> <td class="numLine">&nbsp;432</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;433</td> <td class="nbHitsCovered"><a title="Line 433: Conditional coverage 100% (2/2).">&nbsp;65</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 433: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (Acl acl : toProcess) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;434</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Follow the inheritance chain until it terminates.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;435</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">while</span> (<span class="keyword">true</span>) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;436</td> <td class="nbHitsCovered"><a title="Line 436: Conditional coverage 100% (2/2).">&nbsp;66</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 436: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (checkedAcl.contains(acl)) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;437</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Already processed.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;438</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">break</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;439</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;440</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; checkedAcl.add(acl);</pre></td></tr>
<tr> <td class="numLine">&nbsp;441</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;442</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; DocId parent = acl.getInheritFrom();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;443</td> <td class="nbHitsCovered"><a title="Line 443: Conditional coverage 100% (2/2).">&nbsp;64</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 443: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (parent == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;444</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Inheritance chain terminated; everything looks good.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;445</td> <td class="nbHitsCovered">&nbsp;30</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">break</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;446</td> <td class="nbHitsCovered"><a title="Line 446: Conditional coverage 100% (2/2).">&nbsp;34</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 446: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (missingAcls.contains(parent)) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;447</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Failed to retrieve parent, so give up.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;448</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">break</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;449</td> <td class="nbHitsCovered"><a title="Line 449: Conditional coverage 100% (2/2).">&nbsp;33</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 449: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (acls.containsKey(parent)) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;450</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Already have the parent ACLs, so check parent.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;451</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; acl = acls.get(parent);</pre></td></tr>
<tr> <td class="numLine">&nbsp;452</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLine">&nbsp;453</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Request parent ACLs.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;454</td> <td class="nbHitsCovered">&nbsp;30</td> <td class="src"><pre class="src">&nbsp; pendingRetrieval.add(parent);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;455</td> <td class="nbHitsCovered">&nbsp;30</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">break</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;456</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;457</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;458</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;459</td> <td class="nbHitsCovered">&nbsp;65</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;460</td> <td class="nbHitsCovered">&nbsp;36</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> acls;</pre></td></tr>
<tr> <td class="numLine">&nbsp;461</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;462</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;463</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> List&lt;Acl&gt; createChain(DocId docId, Map&lt;DocId, Acl&gt; acls) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;464</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; List&lt;Acl&gt; chain = <span class="keyword">new</span> LinkedList&lt;Acl&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;465</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; Set&lt;Acl&gt; used = <span class="keyword">new</span> HashSet&lt;Acl&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;466</td> <td class="nbHitsCovered">&nbsp;38</td> <td class="src"><pre class="src">&nbsp; DocId cur = docId;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;467</td> <td class="nbHitsCovered"><a title="Line 467: Conditional coverage 100% (2/2).">&nbsp;102</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 467: Conditional coverage 100% (2/2)."> <span class="keyword">while</span> (cur != <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;468</td> <td class="nbHitsCovered">&nbsp;72</td> <td class="src"><pre class="src">&nbsp; Acl acl = acls.get(cur);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;469</td> <td class="nbHitsCovered"><a title="Line 469: Conditional coverage 100% (2/2).">&nbsp;72</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 469: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (acl == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;470</td> <td class="nbHitsCovered"><a title="Line 470: Conditional coverage 100% (2/2).">&nbsp;6</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 470: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (chain.isEmpty()) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;471</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// The GSA turns this into a chain containing only an empty ACL (which</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;472</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// eventually becomes indeterminate), but we want this to be</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;473</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// indeterminate immediately because we do not have public/private</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;474</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// flags for documents and we don't want to accidentally cause a</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;475</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// document to become public.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;476</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; log.log(Level.FINE, <span class="string">"Document does not seem to use ACLs: {0}"</span>, cur);</pre></td></tr>
<tr> <td class="numLine">&nbsp;477</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;478</td> <td class="nbHitsCovered">&nbsp;4</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Missing ACLs for document ''{0}'' inherited "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;479</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"from another document"</span>, cur);</pre></td></tr>
<tr> <td class="numLine">&nbsp;480</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;481</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;482</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;483</td> <td class="nbHitsCovered"><a title="Line 483: Conditional coverage 100% (2/2).">&nbsp;66</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 483: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (used.contains(acl)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;484</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Detected ACL cycle at ''{0}''"</span>, cur);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;485</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;486</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;487</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; used.add(acl);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;488</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; chain.add(0, acl);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;489</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; cur = acl.getInheritFrom();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;490</td> <td class="nbHitsCovered">&nbsp;64</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;491</td> <td class="nbHitsCovered">&nbsp;30</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> Collections.unmodifiableList(chain);</pre></td></tr>
<tr> <td class="numLine">&nbsp;492</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;493</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;494</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;495</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Equality is determined if all the permit/deny sets are equal and the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;496</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * inheritance is equal.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;497</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;498</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @Override</pre></td></tr>
<tr> <td class="numLine">&nbsp;499</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">boolean</span> equals(Object o) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;500</td> <td class="nbHitsCovered"><a title="Line 500: Conditional coverage 100% (2/2).">&nbsp;62</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 500: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (!(o <span class="keyword">instanceof</span> Acl)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;501</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">false</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;502</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;503</td> <td class="nbHitsCovered"><a title="Line 503: Conditional coverage 100% (2/2).">&nbsp;61</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 503: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (<span class="keyword">this</span> == o) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;504</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">true</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;505</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;506</td> <td class="nbHitsCovered">&nbsp;54</td> <td class="src"><pre class="src">&nbsp; Acl a = (Acl) o;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;507</td> <td class="nbHitsUncovered"><a title="Line 507: Conditional coverage 91% (22/24) [each condition: 100%, 100%, 100%, 100%, 100%, 50%, 50%, 100%, 100%, 100%, 100%, 100%].">&nbsp;54</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 507: Conditional coverage 91% (22/24) [each condition: 100%, 100%, 100%, 100%, 100%, 50%, 50%, 100%, 100%, 100%, 100%, 100%]."> <span class="keyword">return</span> inheritType == a.inheritType</a></span></pre></td></tr>
<tr> <td class="numLine">&nbsp;508</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Handle null case.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;509</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; (inheritFrom == a.inheritFrom</pre></td></tr>
<tr> <td class="numLine">&nbsp;510</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; || (inheritFrom != <span class="keyword">null</span> &amp;&amp; inheritFrom.equals(a.inheritFrom)))</pre></td></tr>
<tr> <td class="numLine">&nbsp;511</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; (inheritFromFragment == a.inheritFromFragment</pre></td></tr>
<tr> <td class="numLine">&nbsp;512</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; || (inheritFromFragment != <span class="keyword">null</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;513</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; inheritFromFragment.equals(a.inheritFromFragment)))</pre></td></tr>
<tr> <td class="numLine">&nbsp;514</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; permitGroups.equals(a.permitGroups)</pre></td></tr>
<tr> <td class="numLine">&nbsp;515</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; denyGroups.equals(a.denyGroups)</pre></td></tr>
<tr> <td class="numLine">&nbsp;516</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; permitUsers.equals(a.permitUsers) &amp;&amp; denyUsers.equals(a.denyUsers)</pre></td></tr>
<tr> <td class="numLine">&nbsp;517</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; &amp;&amp; caseSensitive == a.caseSensitive;</pre></td></tr>
<tr> <td class="numLine">&nbsp;518</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;519</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;520</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;521</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Returns a hash code for this object that agrees with {@code equals}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;522</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;523</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @Override</pre></td></tr>
<tr> <td class="numLine">&nbsp;524</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">int</span> hashCode() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;525</td> <td class="nbHitsCovered">&nbsp;336</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> Arrays.hashCode(<span class="keyword">new</span> Object[] {</pre></td></tr>
<tr> <td class="numLine">&nbsp;526</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; permitGroups, denyGroups, permitUsers, denyUsers,</pre></td></tr>
<tr> <td class="numLine">&nbsp;527</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; inheritFrom, inheritFromFragment, inheritType, caseSensitive</pre></td></tr>
<tr> <td class="numLine">&nbsp;528</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; });</pre></td></tr>
<tr> <td class="numLine">&nbsp;529</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;530</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;531</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;532</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Generates a string useful for debugging that contains users and groups</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;533</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * along with inheritance information.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;534</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;535</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @Override</pre></td></tr>
<tr> <td class="numLine">&nbsp;536</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> String toString() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;537</td> <td class="nbHitsUncovered"><a title="Line 537: Conditional coverage 50% (1/2).">&nbsp;5</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 537: Conditional coverage 50% (1/2)."> <span class="keyword">return</span> <span class="string">"Acl(caseSensitive="</span> + caseSensitive</a></span></pre></td></tr>
<tr> <td class="numLine">&nbsp;538</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">", inheritFrom="</span> + inheritFrom</pre></td></tr>
<tr> <td class="numLine">&nbsp;539</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + (inheritFromFragment == <span class="keyword">null</span> ? <span class="string">""</span> : <span class="string">"#"</span> + inheritFromFragment)</pre></td></tr>
<tr> <td class="numLine">&nbsp;540</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">", inheritType="</span> + inheritType</pre></td></tr>
<tr> <td class="numLine">&nbsp;541</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">", permitGroups="</span> + permitGroups + <span class="string">", denyGroups="</span> + denyGroups</pre></td></tr>
<tr> <td class="numLine">&nbsp;542</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">", permitUsers="</span> + permitUsers + <span class="string">", denyUsers="</span> + denyUsers + <span class="string">")"</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;543</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;544</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;545</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;546</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Batch retrieval of ACLs for efficent processing of many authz checks at</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;547</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * once.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;548</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;549</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * @see Acl#isAuthorizedBatch</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;550</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;551</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">interface</span> BatchRetriever {</pre></td></tr>
<tr> <td class="numLine">&nbsp;552</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;553</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Retrieve the ACLs for the requested DocIds. This method is permitted to</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;554</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * return ACLs for DocIds not requested, but it should never provide a</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;555</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * {@code null} value for a DocId's ACLs. If a DocId does not exist, then it</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;556</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * should be missing in the returned map.</span></pre></td></tr>
<tr> <td