Merge "Add a --no-limit option to the ssh and rest query commands"
This commit is contained in:
@@ -116,6 +116,7 @@ class ChangesImpl implements Changes {
|
||||
}
|
||||
qc.setLimit(q.getLimit());
|
||||
qc.setStart(q.getStart());
|
||||
qc.setNoLimit(q.getNoLimit());
|
||||
for (ListChangesOption option : q.getOptions()) {
|
||||
qc.addOption(option);
|
||||
}
|
||||
|
||||
@@ -124,16 +124,28 @@ public class Util {
|
||||
|
||||
public static PermissionRule allow(
|
||||
ProjectConfig project, String capabilityName, AccountGroup.UUID group) {
|
||||
return allow(project, capabilityName, group, (PermissionRange) null);
|
||||
}
|
||||
|
||||
public static PermissionRule allow(
|
||||
ProjectConfig project,
|
||||
String capabilityName,
|
||||
AccountGroup.UUID group,
|
||||
PermissionRange customRange) {
|
||||
PermissionRule rule = newRule(project, group);
|
||||
project
|
||||
.getAccessSection(AccessSection.GLOBAL_CAPABILITIES, true)
|
||||
.getPermission(capabilityName, true)
|
||||
.add(rule);
|
||||
if (GlobalCapability.hasRange(capabilityName)) {
|
||||
PermissionRange.WithDefaults range = GlobalCapability.getRange(capabilityName);
|
||||
if (range != null) {
|
||||
rule.setRange(range.getDefaultMin(), range.getDefaultMax());
|
||||
if (customRange == null) {
|
||||
PermissionRange.WithDefaults range = GlobalCapability.getRange(capabilityName);
|
||||
if (range != null) {
|
||||
rule.setRange(range.getDefaultMin(), range.getDefaultMax());
|
||||
}
|
||||
return rule;
|
||||
}
|
||||
rule.setRange(customRange.getMin(), customRange.getMax());
|
||||
}
|
||||
return rule;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,10 @@ public class OutputStreamQuery {
|
||||
queryProcessor.setUserProvidedLimit(n);
|
||||
}
|
||||
|
||||
public void setNoLimit(boolean on) {
|
||||
queryProcessor.setNoLimit(on);
|
||||
}
|
||||
|
||||
public void setStart(int n) {
|
||||
queryProcessor.setStart(n);
|
||||
}
|
||||
|
||||
@@ -82,6 +82,11 @@ public class QueryChanges implements RestReadView<TopLevelResource>, DynamicOpti
|
||||
imp.setStart(start);
|
||||
}
|
||||
|
||||
@Option(name = "--no-limit", usage = "Return all results, overriding the default limit")
|
||||
public void setNoLimit(boolean on) {
|
||||
imp.setNoLimit(on);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDynamicBean(String plugin, DynamicOptions.DynamicBean dynamicBean) {
|
||||
imp.setDynamicBean(plugin, dynamicBean);
|
||||
|
||||
Reference in New Issue
Block a user