use of com.google.gerrit.server.project.SectionMatcher in project gerrit by GerritCodeReview.
the class ProjectControl method allRefPatterns.
private Set<String> allRefPatterns(String permissionName) {
Set<String> all = new HashSet<>();
for (SectionMatcher matcher : access()) {
AccessSection section = matcher.getSection();
Permission permission = section.getPermission(permissionName);
if (permission != null) {
all.add(section.getName());
}
}
return all;
}
use of com.google.gerrit.server.project.SectionMatcher in project gerrit by GerritCodeReview.
the class ProjectControl method canPerformOnAnyRef.
private boolean canPerformOnAnyRef(String permissionName) {
for (SectionMatcher matcher : access()) {
AccessSection section = matcher.getSection();
Permission permission = section.getPermission(permissionName);
if (permission == null) {
continue;
}
Boolean can = canPerform(permissionName, section, permission);
if (can != null) {
return can;
}
}
return false;
}
use of com.google.gerrit.server.project.SectionMatcher in project gerrit by GerritCodeReview.
the class ProjectControl method canPerformOnTagRef.
private boolean canPerformOnTagRef(String permissionName) {
for (SectionMatcher matcher : access()) {
AccessSection section = matcher.getSection();
if (section.getName().startsWith(REFS_TAGS) || section.getName().startsWith(REGEX_PREFIX + REFS_TAGS)) {
Permission permission = section.getPermission(permissionName);
if (permission == null) {
continue;
}
Boolean can = canPerform(permissionName, section, permission);
if (can != null) {
return can;
}
}
}
return false;
}
Aggregations