$k. AccessRights

Global access rights API

Methods

(static) checkOperation(context) → {Boolean}

Check access right

Parameters:
NameTypeDescription
contextobject

List of possible operation types: createAttribute { attributeType, element }, createCompleteRelation { relationType, sourceElement, targetElement }, createConcept { superType }, createInstance { type }, createRelation { relationType, sourceElement, targetElement }, delete { element }, deleteAttribute { attribute, element }, deleteConcept { element }, deleteExtension { element, object }, deleteInstance { element }, deleteRelation { relation, element }, modify { element }, modifyAttributeValue { attribute, element }, modifySchema { element }, read { element }, readAttribute { attribute, element }, readConcept { type }, readExtension { element }, readInstance { object }, readObjectsOfType { type }, validateAttributeValue { attributeValue, language, attribute, element }, optional can additionally set the user, e.g. $k.checkAccessRight("read", { "user" :, "element" :})

Since
  • 5.4.0
Throws:
Returns:

The decision as boolean

Type: 
Boolean

(static) filterElements(elements, operationType, contextopt, decisionopt) → {Array.<$k.SemanticElement>}

Filter semantic elements in array with access rights

Parameters:
NameTypeAttributesDescription
elementsArray.<$k.SemanticElement>
operationTypestring

List of possible operation types: delete, deleteConcept, deleteInstance, modify, modifySchema, read, readExtension, readInstance

contextobject<optional>
decisionobject<optional>

Default is true

Since
  • 5.4.0
Throws:
Returns:

Returns the filtered semantic elements

Type: 
Array.<$k.SemanticElement>

(static) getDecision(context) → {$k.Decision}

Get access right decision

Parameters:
NameTypeDescription
contextobject

List of possible operation types: createAttribute { attributeType, element }, createCompleteRelation { relationType, sourceElement, targetElement }, createConcept { superType }, createInstance { type }, createRelation { relationType, sourceElement, targetElement }, delete { element }, deleteAttribute { attribute, element }, deleteConcept { element }, deleteExtension { element, object }, deleteInstance { element }, deleteRelation { relation, element }, modify { element }, modifyAttributeValue { attribute, element }, modifySchema { element }, read { element }, readAttribute { attribute, element }, readConcept { type }, readExtension { element }, readInstance { object }, readObjectsOfType { type }, validateAttributeValue { attributeValue, language, attribute, element }, optional can additionally set the user, e.g. $k.checkAccessRight("read", { "user" :, "element" :})

Since
  • 5.4.0
Throws:
Returns:

The decision

Type: 
$k.Decision