In SimpleOne, access to content items and categories are controlled by the system administrators. They can create user criteria records and define access conditions for any objects based on criteria specified.

Creating a user criteria record


Role required: admin, security_admin (full management: create-read-update-delete, also known as CRUD).

Users with non-admin roles can only view user criteria created earlier.

To create a user criteria record, please complete the steps below:

  1. Navigate to User Administration → User Criteria.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply the changes.

User criteria form fields

FieldMandatoryDescription
NameNSpecify the record name.
RolesNSpecify the role to match.
GroupsNSpecify the group to match.
UsersNSpecify the user record to match.
Advanced conditionsNSelect this checkbox to specify a more precise condition to evaluate. When selected, the Conditions field appears.
ConditionsN

Specify a more precise condition for your criteria using the Condition Builder. Empty condition always returns 'true'.

This field appears when the Advanced conditions checkbox is selected.

Specified conditions are applied to users from the Employee table. For users from the User table and other tables extended from it or from the Employee table, specified conditions return 'false'.

Match all rolesN

Select this checkbox if the user must have all roles specified in the Roles field to meet the criteria.

Match all groupsNSelect this checkbox if the user must be a member of all the groups specified in the Groups field to meet the criteria.
ActiveNSelect this checkbox to activate or deactivate the user criteria record.
CompaniesNSpecify the employee's company to match. Leave this field blank if users from all companies are allowed.
LocationsNSpecify the employee's location to match. Leave this field blank if users from all locations are allowed.
DivisionsNSpecify the employee's divisions to match. Leave this field blank if users from all divisions are allowed.
Match allN

Select this checkbox if all conditions in this record must be met to provide access. If unselected, the user must meet one of the criteria to gain access.

As an example, we take a user criteria record with the following conditions:

  • Location P or Q
  • Company X or Y.

If the Match all checkbox is selected, access is permitted only to users with these locations and companies. That is, an employee from company X and location Q can access the item as well as an employee from company Y and location P.

If the Match all checkbox is cleared, a user must meet at least one of these conditions. That is, an employee with a location Q as well as an employee with company X.

API Usage


When working with the user criteria functionality, the SimpleUserCriteria server-side API class enables you to perform your tasks.

Use case


You need to restrict the access to the Service Catalog so that only certain users could access and manage it: users with the content_manager role from Moscow, Russia. To do so, create a user criteria record and specify the conditions, then you need to add the user criteria to the ACLs:

  1. Navigate to User Administration → User Criteria.
  2. Click New and fill in the fields:

    FieldValue
    NameService Catalog User Criteria
    Rolescontent_manager
    LocationMoscow, Russia
  3. Navigate to ACLs and click New. In the new page, in the Table field, select “Service Catalog”.
  4. Complete the script as follows with the SimpleUserCriteria() methods.

    userAcceptanceByCriteria
    const uc = new SimpleUserCriteria();
    ss.info(uc.userAcceptanceByCriteria(ss.getUserID(), '158617888715304763'));
    // Info: true

  • No labels