About ruletype to match users and pages

You can use the ruletype 'USER_GROUP_TO_PAGE_LABEL' to only match user and page pairs if they have the same name. This can greatly reduce the number of rules you create.

Ruletype

The 'USER_GROUP_TO_PAGE_LABEL' ruletype looks at the user and page pairs you have specified in the page filter and the user filter. It then checks if there are any instances where the names of user groups are the same as the names of page labels. The rule then only applies to those matching pairs. 

The ruletype does not consider other filters, such as the space name, space key or user email filters.

Example

For example, you have the following user groups and page labels:

User groupsPage labels

trn_employees

trn_managers

trn_hr

trn_documents

trn_policies

trn_employees

trn_managers

trn_hr

Rather than making multiple rules to specify the right pairs, you create just one rule with the ruletype 'USER_GROUP_TO_PAGE_LABEL':

  1. You create a broad scope of user and page pairs, for example by using regular expressions or by using a space key.
  2. You reduce the scope again with this ruletype to only apply to pairs where the name values match.

In the example rule below:

  1. The rule applies to:
    • All pages within the QualityDocuments space that have a page label that starts with 'trn_'
    • All user groups that start with 'trn_'
  2. The 'USER_GROUP_TO_PAGE_LABEL' ruletype ensures the ruleonly applies to matching name values:
    • trn_employees are asked to train only on trn_employees pages.
    • trn_managers are asked to train only on trn_manager pages.
    • trn_hr personnel are only asked to train on trn_hr pages.


{
  "rules": [
    {
      "name": "training 1",
      "pageFilter": {
        "and": [
          {
            "type": "PAGE_SPACE_KEY",
            "value": "QualityDocuments"
          },
         
          {
            "type": "PAGE_LABEL",
            "value": "trn_+"
          }
        ]
      },
      "userFilter": {
        "type": "USER_GROUP",
        "value": "trn_+"
      },
      "ruleTypes": [
        {
          "ruleType": "USER_GROUP_TO_PAGE_LABEL"
          "ruleType": "NOT_TRAINED_VERSION"
        }
      ]
    }
  ]
}