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

net.nemerosa.ontrack.model.security.AccountGroupMapping.kt Maven / Gradle / Ivy

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

import net.nemerosa.ontrack.model.form.Form
import net.nemerosa.ontrack.model.form.Form.Companion.create
import net.nemerosa.ontrack.model.form.Selection
import net.nemerosa.ontrack.model.structure.Entity
import net.nemerosa.ontrack.model.structure.ID

/**
 * Defines a mapping between a provided group (by a LDAP system for example)
 * and an actual Ontrack [group][AccountGroup].
 *
 * @property id Unique ID of this mapping
 * @property authenticationSource Authentication source
 * @property name Name of the provided group
 * @property group ID of the [AccountGroup]
 */
data class AccountGroupMapping(
        override val id: ID,
        val authenticationSource: AuthenticationSource,
        val name: String,
        val group: AccountGroup
) : Entity {

    fun asForm(groups: List): Form = form(groups)
            .fill("name", name)
            .fill("group", group.id)

    companion object {
        @JvmStatic
        fun form(groups: List): Form = create()
                .name()
                .with(
                        Selection.of("group")
                                .label("Group")
                                .items(groups)
                )
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy