Syntax

$parent.canCreate($reference)

canCreate($parent, $reference)

Description

Checks whether the currently logged-in user is allowed to create a new element in the given composition reference of the given parent object and returns a boolean.

This corresponds to the write access to the composition context (the same check that gates adding an element to the reference). The function never fails and never filters.

The check is evaluated for the currently logged-in user and follows the same rules as the implicit permission enforcement: deny-by-default, role inheritance along the security hierarchy, and full access for administrators or executions in a system context.

Parameters

NameTypeType DescriptionMandatoryDefault
parentBusiness objectThe container object that will hold the new element.yes
referenceAttributeThe composition reference (TLStructuredTypePart) into which the element is created.yes

Return value

Type: Boolean

true if the current user may create an element in the given reference of the parent, false otherwise.

Examples

Example 1

$project.canCreate(`my.module:Project#milestones`)

Output: Whether the logged-in user may add a milestone to the project.