本文整理汇总了Java中com.google.gerrit.common.data.PermissionRule.setGroup方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionRule.setGroup方法的具体用法?Java PermissionRule.setGroup怎么用?Java PermissionRule.setGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gerrit.common.data.PermissionRule
的用法示例。
在下文中一共展示了PermissionRule.setGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replace
import com.google.gerrit.common.data.PermissionRule; //导入方法依赖的package包/类
public void replace(AccessSection section) {
for (Permission permission : section.getPermissions()) {
for (PermissionRule rule : permission.getRules()) {
rule.setGroup(resolve(rule.getGroup()));
}
}
accessSections.put(section.getName(), section);
}
示例2: loadPermissionRules
import com.google.gerrit.common.data.PermissionRule; //导入方法依赖的package包/类
private void loadPermissionRules(
Config rc,
String section,
String subsection,
String varName,
Map<String, GroupReference> groupsByName,
Permission perm,
boolean useRange) {
for (String ruleString : rc.getStringList(section, subsection, varName)) {
PermissionRule rule;
try {
rule = PermissionRule.fromString(ruleString, useRange);
} catch (IllegalArgumentException notRule) {
error(
new ValidationError(
PROJECT_CONFIG,
"Invalid rule in "
+ section
+ (subsection != null ? "." + subsection : "")
+ "."
+ varName
+ ": "
+ notRule.getMessage()));
continue;
}
GroupReference ref = groupsByName.get(rule.getGroup().getName());
if (ref == null) {
// The group wasn't mentioned in the groups table, so there is
// no valid UUID for it. Pool the reference anyway so at least
// all rules in the same file share the same GroupReference.
//
ref = rule.getGroup();
groupsByName.put(ref.getName(), ref);
error(
new ValidationError(
PROJECT_CONFIG, "group \"" + ref.getName() + "\" not in " + GroupList.FILE_NAME));
}
rule.setGroup(ref);
perm.add(rule);
}
}