Project read permission was not enforced via /jobCaseInsensitive/jobname path.

Added unit test.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23629 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
mindless committed 2009-11-10 07:08:14 +00:00
1 parent 64cb39fe50
commit 79f22cd661
3 files changed
+23 -2

No files matched your search

+5 -2
View File
@@ -1796,9 +1796,12 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
* Used only for mapping jobs to URL in a case-insensitive fashion.
*/
public TopLevelItem getJobCaseInsensitive(String name) {
String match = Functions.toEmailSafeString(name);
for (Entry<String, TopLevelItem> e : items.entrySet()) {
if(Functions.toEmailSafeString(e.getKey()).equalsIgnoreCase(Functions.toEmailSafeString(name)))
return e.getValue();
if(Functions.toEmailSafeString(e.getKey()).equalsIgnoreCase(match)) {
TopLevelItem item = e.getValue();
return item.hasPermission(Item.READ) ? item : null;
}
}
return null;
}