use of com.thoughtworks.go.config.policy.Policy in project gocd by gocd.
the class PermissionsServiceIntegrationTest method definePolicy.
private void definePolicy(CruiseConfig cruiseConfig, String type, String resource1, String resource2) {
Role role = new RoleConfig("gocd", new RoleUser(SessionUtils.currentUsername().getUsername()));
Policy policy = new Policy();
policy.add(new Allow("view", type, resource1));
policy.add(new Allow("administer", type, resource2));
role.setPolicy(policy);
cruiseConfig.server().security().getRoles().add(role);
}
Aggregations