Sightglass users

Users are the people who have access to a solution. Sightglass users must be Aunsight users, and members of the organization that owns the Sightglass solution. They do not need to have any Aunsight roles within their organization.

Disabled Tools

users[].disabled_tools = []

In some cases, you may not want users to have access to all the tools in a solution. For example, you may have two types of users- general employees, and managers. One of the tools provides managers insights about the performance of each of their employees. This would not be appropriate for general employees to have access to, so you can disable their access to those tools.

Disabled tools will not be displayed at all for that user.

The disabled_tools value is an array of tool ids. Example:

    {
      "id": "f2dd3ff8-47db-8d18-b962-bbd7ead212b9",
      "disabled_tools": ["employee_performance"]
    }

User-specific data source filters

users[].data_source_filters = {}

A data_source can be filtered in a specific way for each user. This is a powerful tool that has many potential use cases, and allows you to limit or tailor data for a specific user.

You can define any number of filters on a per-data_source scope. These filters are applied when the user queries for data, and override any filters set in a tool. If a data_source is used in multiple tools, the same filter will be applied to all queries for that data_source.

Example 1:

    {
      "id": "20707a6da6d2e-4f87-4f87-8cdd-d54146ebb610",
      "data_source_filters": {
        "overview": [
          {
            "field": "user",
            "value": "Engel, Charlie",
            "op": "eq"
          }
        ]
      }
    }

In this example, when the specified user loads a tool that uses the data_source overview, the server will only return Atoms from the data_source where the field user is equal to Engel, Charlie.

The following operators are available:

  • eq- Equal
  • lt - Less than
  • lte - Less than or equal to
  • gt - Greater than
  • gte - Greater than or equal to
  • ne - Not equal
  • in - Matches any item in array
  • nin - Matches none of the values in an array
  • startswith - String starts with

If multiple filters are applied for a data_source, a query will return Atoms that match all filters, using an AND comparison.

Example 2:

    {
      "id": "20707a6da6d2e-4f87-4f87-8cdd-d54146ebb610",
      "data_source_filters": {
        "companies": [
          {
            "field": "country",
            "op": "eq",
            "value": "Germany"
          },
          {
            "field": "stock",
            "op": "lt",
            "value": 200
          },
          {
            "field": "stock",
            "op": "in",
            "value": [
              198,
              23
            ]
          }
        ]
      }
    }

In this example, when the specified user loads a tool that uses the data_source companies, the server will only return Atoms from the data_source where:

  • The field country equals “Germany”, AND
  • The field stock is a number less than 200, AND
  • the field stock is a number that is either 198 OR 23.

It’s strongly recommended that you use the same type of value in both the filter and the data_source field. Comparing the string "200" with the integer 200 or the string "TRUE" with the boolean TRUE may have unexpected results.

Combining user-specific and view data source filters

It’s strongly recommended that you do not filter an attribute in both user-specific filters and filters on data sources in views for the same user. The mobile app does not know how you are filtering the data source for a user, and so it can not react to those filters. Users who have a user-specific filter applied may see filter options that are invalid for them.

Filters that are exposed in tools should have options that are applicable to all users who have access to that tool. If different users should have different filter options, you must create separate tools for each use case, and then disable tools for users who shouldn’t have access to a specific tool.