Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Api
  • Queries
  • Referenced Instances

Last edited by Andrea Pavlovic May 25, 2021
Page history

Referenced Instances

TOC

  • Customer
    • ticket queries
    • external_comment queries

A basic concept of the Genesis Database is the inheritance of permissions.

Permissions are always based on the main entity which is being queried. If the query returns an instance, joins of certain references are permitted, while others are not. For an instance which is not returned, no joining is possible, so none of data the references there will be returned.

This is more easily explained with an example. Let's take a ticketing system. We have tickets with internal comments (only visible to employees) and external comments (visible to employees and requester).

permission_inheritance.png

The different type of comments (internal vs external) get split in two different entities. Employees get explicit access rights to all three entities (ticket, internal, external), while customers get explicit rights on just two (ticket, external).

The comment entities have references into the ticket entity so we know which ticket they belong to.

An employee can list both internal and external comments directly or join them to the ticket entity.

Customer

ticket queries

A query on ticket may join/prefetch external_comments and return any instances from there which reference to tickets the customer has access to, because external_comments is explicitly listed in the universe.

A query joining internal_comment is forbidden because this entity is not listed explicitly in the universe.

external_comment queries

A customer can do a query on external_comment and will get instances according to the ACLs. Also, join/prefetch of the referenced tickets is permitted, regardless of the permission on ticket itself.

Note that joining might return instances which are not returned in a listing.

Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages