Service for IssueTemplates. Provides functions to create, update and delete

Parameters

repository

the associated repository used for CRUD functionality

Constructors

Link copied to clipboard
constructor(repository: IssueTemplateRepository)

Properties

Link copied to clipboard
@Autowired
lateinit var authorizationChecker: AuthorizationChecker

Injected, used for the checkPermission function

Link copied to clipboard

Injected, used to get a user based on a GropiusAuthorizationContext

Link copied to clipboard
@Autowired
private lateinit var jsonNodeMapper: JsonNodeMapper
Link copied to clipboard

Functions

Link copied to clipboard

Checks for CAN_CREATE_TEMPLATE permission on the user provided via authorizationContext

Link copied to clipboard
suspend fun checkIsAdmin(authorizationContext: GropiusAuthorizationContext, errorMessage: String)

Checks if the user defined by authorizationContext is a global admin

Link copied to clipboard
suspend fun checkPermission(node: Node, permission: Permission, errorMessage: String)

Checks if the permission is granted on node If checkPermission on the permission.context is false, no permission is evaluated Does not handle the case that the user is an admin

Link copied to clipboard

Updates template based on input Sets templateFieldSpecifications based on input, and the templateFieldSpecification of extendedTemplates

Link copied to clipboard
suspend fun createdTemplate(template: IssueTemplate, input: CreateTemplateInput)

Updates template based on input Sets extends and templateFieldSpecifications

Link copied to clipboard

Creates a new IssueTemplate based on the provided input Checks the authorization status

Link copied to clipboard
suspend fun evaluatePermission(node: Node, permission: Permission): Boolean

Evaluates if the permission is granted on node If checkPermission on the permission.context is false, no permission is evaluated Does not handle the case that the user is an admin

Link copied to clipboard

Returns all templates which extend the template with the provided ids Includes the template with the provided ids, and indirect extending templates.

Link copied to clipboard
suspend fun getUser(authorizationContext: GropiusAuthorizationContext): GropiusUser

Gets a GropiusUser based on the userId from the authorizationContext

Link copied to clipboard

Updates an IssueTemplate based on the provided input Checks the authorization status

Link copied to clipboard

Updates node based on input Updates name and description