net.nemerosa.ontrack.model.security.GlobalRole.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.security
import java.io.Serializable
/**
* A global role defines the association between a name, a set of
* [global functions][net.nemerosa.ontrack.model.security.GlobalFunction]
* and a set of [project functions][net.nemerosa.ontrack.model.security.ProjectFunction]
* that are attributed for all projects.
*/
data class GlobalRole(
/**
* Global role's identifier
*/
val id: String,
/**
* Global role's name
*/
val name: String,
/**
* Description of the role
*/
val description: String,
/**
* Global functions
*/
val globalFunctions: Set>,
/**
* Project functions to grant for all projects
*/
val projectFunctions: Set>
) : Serializable {
fun isGlobalFunctionGranted(fn: Class): Boolean = globalFunctions.contains(fn)
fun isProjectFunctionGranted(fn: Class): Boolean =
projectFunctions.any { fn.isAssignableFrom(it) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy