Support enabling/disabling commentlink sections per-project
Allow project admins to customize which commentlinks apply to their section of the project hierarchy by selectively setting the enabled bit on each commentlink section. This allows site admins to create raw HTML commentlinks with less XSS risk (or at least more auditing) and not have them apply to every project. Change-Id: I8dd31aab98379f90253bbfdd9f669a7f5f78c25f
This commit is contained in:
@@ -382,7 +382,16 @@ public class ProjectState {
|
||||
}
|
||||
for (ProjectState s : treeInOrder()) {
|
||||
for (CommentLinkInfo cl : s.getConfig().getCommentLinkSections()) {
|
||||
cls.put(cl.name.toLowerCase(), cl);
|
||||
String name = cl.name.toLowerCase();
|
||||
if (cl.isOverrideOnly()) {
|
||||
CommentLinkInfo parent = cls.get(name);
|
||||
if (parent == null) {
|
||||
continue; // Ignore invalid overrides.
|
||||
}
|
||||
cls.put(name, cl.inherit(parent));
|
||||
} else {
|
||||
cls.put(name, cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ImmutableList.copyOf(cls.values());
|
||||
|
||||
Reference in New Issue
Block a user