@Service
class InterfaceSpecificationService(repository: InterfaceSpecificationRepository, val componentRepository: ComponentRepository, val interfaceSpecificationVersionService: InterfaceSpecificationVersionService, val interfacePartService: InterfacePartService, val templatedNodeService: TemplatedNodeService, val interfaceSpecificationTemplateRepository: InterfaceSpecificationTemplateRepository, val nodeRepository: NodeRepository, val templateService: TemplateService) : NamedAffectedByIssueService<InterfaceSpecification, InterfaceSpecificationRepository>

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

Parameters

repository

the associated repository used for CRUD functionality

componentRepository

used to get Components

interfaceSpecificationVersionService
interfacePartService

used to create InterfaceParts

templatedNodeService

used to update templatedFields

interfaceSpecificationTemplateRepository
nodeRepository

used to save/delete any node

Constructors

Link copied to clipboard
constructor(repository: InterfaceSpecificationRepository, componentRepository: ComponentRepository, interfaceSpecificationVersionService: InterfaceSpecificationVersionService, interfacePartService: InterfacePartService, templatedNodeService: TemplatedNodeService, interfaceSpecificationTemplateRepository: InterfaceSpecificationTemplateRepository, nodeRepository: NodeRepository, templateService: TemplateService)

Properties

Link copied to clipboard
@Autowired
lateinit var authorizationChecker: AuthorizationChecker

Injected, used for the checkPermission function

Link copied to clipboard
Link copied to clipboard

Injected, used to get a user based on a GropiusAuthorizationContext

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

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

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

Creates a new InterfaceSpecification based on the provided input on component Does not check the authorization status, does not save the created nodes Validates the input

Link copied to clipboard

Deletes a InterfaceSpecification by id 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
suspend fun getUser(authorizationContext: GropiusAuthorizationContext): GropiusUser

Gets a GropiusUser based on the userId from the authorizationContext

Link copied to clipboard

Updates a InterfaceSpecification based on the provided input Checks the authorization status

Link copied to clipboard
private suspend fun updateInterfaceSpecificationTemplate(input: UpdateInterfaceSpecificationInput, interfaceSpecification: InterfaceSpecification, updateContext: NodeBatchUpdateContext): Set<Node>

Updates the template of an interfaceSpecification, if provided via the input Does not check the authorization status

Updates the InterfaceSpecificationVersions of the interfaceSpecification after a template update Does not check the authorization status

Link copied to clipboard

Updates node based on input Updates name and description