All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.settings.SecuritySettings Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.settings;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Wither;
import net.nemerosa.ontrack.model.form.Form;
import net.nemerosa.ontrack.model.form.YesNo;

@Data
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class SecuritySettings {

    @Wither
    private final boolean grantProjectViewToAll;

    /**
     * By default, grants view accesses to everybody.
     */
    public static SecuritySettings of() {
        return new SecuritySettings(true);
    }

    public Form form() {
        return Form.create()
                .with(
                        YesNo.of("grantProjectViewToAll")
                                .label("Grants project view to all")
                                .help("Unless disabled at project level, this would enable any user (even anonymous) " +
                                        "to view the content of all projects.")
                                .value(isGrantProjectViewToAll())
                );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy