Search in sources :

Example 1 with AdminRole

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;
}
Also used : AdminUser(com.thoughtworks.go.config.AdminUser) AdminRole(com.thoughtworks.go.config.AdminRole) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) AdminsConfig(com.thoughtworks.go.config.AdminsConfig)

Example 2 with AdminRole

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;
}
Also used : AdminUser(com.thoughtworks.go.config.AdminUser) AuthConfig(com.thoughtworks.go.config.AuthConfig) AdminRole(com.thoughtworks.go.config.AdminRole) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 3 with AdminRole

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;
}
Also used : AdminUser(com.thoughtworks.go.config.AdminUser) AuthConfig(com.thoughtworks.go.config.AuthConfig) AdminRole(com.thoughtworks.go.config.AdminRole) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 4 with AdminRole

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;
}
Also used : AdminUser(com.thoughtworks.go.config.AdminUser) AuthConfig(com.thoughtworks.go.config.AuthConfig) AdminRole(com.thoughtworks.go.config.AdminRole) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Aggregations

AdminRole (com.thoughtworks.go.config.AdminRole)4 AdminUser (com.thoughtworks.go.config.AdminUser)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 AuthConfig (com.thoughtworks.go.config.AuthConfig)3 AdminsConfig (com.thoughtworks.go.config.AdminsConfig)1