Class MembershipAccessTrait

The membership access trait handles the access control rules around memberships.

Migration notes:

  • if you don't want to change the policy files, do the next steps. Or you can skip them, but it might require an additional changes in the policy files.
  • move your 'parents' field to the trait (see the usage section)
  • if an entity doesn't have 'parents' field add the trait anyway, just without 'parents' config (e.g. in Organisation).
  • the trait must be the first in the list of traits, but below data_objects

Usage:

 id: /Activity
label: Activity
$ref: /Base
type: object
traits:
- type: membership_access
parents:
- type: Content
edge: hasActivity
direction: in
- type: Menu
edge: hasActivity
direction: in

Hierarchy

Constructors

Properties

_applyConditionsFor: ActionsType[] = ...

Trait instance configuration.

_global: boolean = false

Whether this is a global (not bound to any specific schema item) trait instance.

_schemaManager: SchemaManager
_source?: string
_type?: "membershipAccess"

Trait type.

Methods

  • Get all rules for accessing content via the access control paths starting from the user. Rules are assumed to start from an entity of which the user has already been determined to be a direct or transitive member.

    Parameters

    • vertexTypes: string[]
    • target: string
    • childDefs: SchemaItemsKeyedByType
    • processed: string[]

    Returns string[]

  • Get all the rules for finding ancestors of a vertex type.

    Returns a pseudo-gremlin rule.

    Parameters

    • vertex: string

    Returns null | string

  • Get the default policy statement.

    Parameters

    • vertexName: string
    • type: string

    Returns DefaultPolicyStatement

  • This method is triggered when a trait callback has been activated

    Type Parameters

    • RT = any

    • Payload = any

    Parameters

    • callbackName: string

      This is the name of the callback function to call.

    • datasourceWrapper: DataSourceWrapper

      References to the Graph Hanlder

    • data: TraitDataObject<RT, Payload, Promise<any>>

      Request data passed along as part of the request.

    Returns Promise<RT>

Generated using TypeDoc