Options
All
  • Public
  • Public/Protected
  • All
Menu

This extension allows an app to declare that certain security principals (users) have permission to change certain data, identified by data shapes.

see

the white paper

experimental

Hierarchy

  • WritePermitted

Implements

Index

Properties

constraints

constraints: { apply: (Anonymous function); check: (Anonymous function) }[] = [{check: this.checkPermissions,apply: this.checkPermissions}]

Methods

initFromData

invalidate

  • invalidate(): void

Static declare

  • declare(priority: number): Subject
  • Extension declaration. Insert into the domain data to install the extension. For example (assuming a m-ld clone object):

    clone.write(WritePermitted.declare(0));
    

    Parameters

    • priority: number

      the preferred index into the existing list of extensions (lower value is higher priority).

    Returns Subject

Static declareControlled

  • Declares that some set of shapes are controlled by a write permission, that is, they cannot change without the principal being assigned this permission.

    For example (assuming a m-ld clone object):

    clone.write(Statutory.declareControlled(
      'namePermission', { '@id': 'documentStateShape' }
    ));
    

    Parameters

    • permissionIri: Iri

      the permission's identity (e.g. for use in declarePermission)

    • Rest ...controlledShapes: (Subject | Reference)[]

      shape Subjects, or References to pre-existing shapes

    Returns Subject

Static declarePermission

  • Declares a principal to have permission to write some shape, for example (assuming a m-ld clone object):

    clone.write(Statutory.declarePermission(
      'https://alice.example/profile#me',
      { '@id': 'namePermission' }
    ));
    

    Parameters

    • principalIri: Iri

      the principal's identity. As for all domain data, this can be a relative IRI, e.g. 'fred'.

    • permission: Reference

      the permission Reference

    Returns Subject

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.10.0 Source code licensed MIT. Privacy policy