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

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

There is a newer version: 4.4.5
Show newest version
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