use of com.thoughtworks.go.config.AdminRole in project gocd by gocd.
the class AdminsConfigRepresenter method fromJSON.
public static AdminsConfig fromJSON(JsonReader jsonReader) {
AdminsConfig adminsConfig = new AdminsConfig();
jsonReader.readArrayIfPresent("users", users -> {
users.forEach(user -> adminsConfig.add(new AdminUser(new CaseInsensitiveString(user.getAsString()))));
});
jsonReader.readArrayIfPresent("roles", roles -> {
roles.forEach(role -> adminsConfig.add(new AdminRole(new CaseInsensitiveString(role.getAsString()))));
});
return adminsConfig;
}
use of com.thoughtworks.go.config.AdminRole in project gocd by gocd.
the class StageAuthorizationRepresenter method fromJSON.
public static AuthConfig fromJSON(JsonReader jsonReader) {
AuthConfig authConfig = new AuthConfig();
jsonReader.readArrayIfPresent("roles", roles -> {
roles.forEach(role -> {
authConfig.add(new AdminRole(new CaseInsensitiveString(role.getAsString())));
});
});
jsonReader.readArrayIfPresent("users", users -> {
users.forEach(user -> {
authConfig.add(new AdminUser(new CaseInsensitiveString(user.getAsString())));
});
});
return authConfig;
}
use of com.thoughtworks.go.config.AdminRole in project gocd by gocd.
the class StageAuthorizationRepresenter method fromJSON.
public static AuthConfig fromJSON(JsonReader jsonReader) {
AuthConfig authConfig = new AuthConfig();
jsonReader.readArrayIfPresent("roles", roles -> {
roles.forEach(role -> {
authConfig.add(new AdminRole(new CaseInsensitiveString(role.getAsString())));
});
});
jsonReader.readArrayIfPresent("users", users -> {
users.forEach(user -> {
authConfig.add(new AdminUser(new CaseInsensitiveString(user.getAsString())));
});
});
return authConfig;
}
use of com.thoughtworks.go.config.AdminRole in project gocd by gocd.
the class StageAuthorizationRepresenter method fromJSON.
public static AuthConfig fromJSON(JsonReader jsonReader) {
AuthConfig authConfig = new AuthConfig();
jsonReader.readArrayIfPresent("roles", roles -> {
roles.forEach(role -> {
authConfig.add(new AdminRole(new CaseInsensitiveString(role.getAsString())));
});
});
jsonReader.readArrayIfPresent("users", users -> {
users.forEach(user -> {
authConfig.add(new AdminUser(new CaseInsensitiveString(user.getAsString())));
});
});
return authConfig;
}
Aggregations