You can set limits on the size of tables that users can create.
Overview of User Query Limits
- You can restrict the number of fields, rows, columns, wafers, or total cells that users can add to a table.
- The query limits apply to groups rather than individual users. If you have not already done so, you will need to organise your users into groups. See Users, Groups and Permissions for more information about this step.
- There are also some default limits that apply to all users. The defaults are designed to prevent users from creating very large tables.
- If a user belongs to multiple groups, and you set different limits for those groups, then the lower limit will apply to that user.
- If a limit is not defined for a particular group (or is defined incorrectly) then there will be no restrictions applied to that group (apart from the default limits).
- If a user loads a predefined table with more items than allowed by their limits or you have configured mandatory fields and these fields push the user over their limit, then the table will open but the user will not be able to add anything else to the table unless they remove some items to get under their configured limit.
- If a user hits one of the axis limits, then they can continue to add items to the other axes until they hit their limit on that axis too. For example if a user hits the column limit they can continue to add to the table rows until they reach the row limit.
Configure the Limits
Query limits are configured in SuperADMIN, using the
cfg command. You will not need to restart SuperWEB2 to pick up the changes you make in SuperADMIN (although if you currently have SuperWEB2 Table View open, you will need to go back to the catalogue and reopen the dataset to see any changes). This also applies to any users who currently have Table View open. They will not see the effect of your changes until they reselect the dataset from the catalogue.
In addition, you should note that any changes to users and groups are not applied until users log out and back in again. So if you have just changed group memberships (with the
account command) as part of setting up the query limits, then those changes will not be applied until users log in again.
Configure the Default Limits for All Users
defaultQueryLimits are active by default and apply to all users.
You can check the current settings using the following command:
These defaults will prevent any user from creating a table with more than 10,000,000 cells, 1,000 wafers, 1,000,000 columns, 1,000,000 rows or 10 fields.
You should not need to change these settings. However, if you wish to adjust the limits, you can use the following commands:
For example, if you wish to decrease the total number of cells users can include in a table to 1,000,000, you would use the following command
Configure User/Group Limits
Before starting to configure the group limits, it is a good idea to use the following command to check whether any group limits are currently defined:
SuperWEB2 will either display the list of existing limits (if some are already defined), or display "not found".
Scenario A: No Existing Limits Defined
If there are no existing limits defined, SuperADMIN displays the message "not found":
To create a new set of limits for a particular group, use the following commands:
<index>is the index for this set of query limits. Each set of limits has a unique index number, starting from zero.
<group_id>is the ID of the group that this set of limits applies to.
<wafers>are the maximum number of each item that users belonging to this group will be allowed to add to a table.
For example, the following commands specify the limits for users who belong to a group called Guests. As this is the first set of limits we have defined it has the index value of 0.
In this example, any users who belong to the Guests group will not be able to create a table that contains any of the following:
- More than 5 fields.
- More than 50 cells in total.
- More than 10 rows.
- More than 10 columns.
- More than 1 wafer.
To add a second set of limits, use the same commands but increment the index value. For example:
Scenario B: Existing Limits Defined
If there are already some existing limits defined, then SuperADMIN displays the details. For example:
In this example there are two existing sets of limits defined, one for Guests and one for Administrators (each one is enclosed in curly brackets).
You can either add a new set of limits or update one of these existing ones:
To add a new set of limits for a third group, simply make sure that you use the next index value up. In this example, there are already two sets of limits, so to create a third one you must use the index value of 2 (because the index numbering starts at 0). For example:
To update an existing set of limits, simply use the index value of the existing rule. For example, to change the row limit for the Guests group, use the index value of 0:
When you have finished configuring the limits, you may wish to login to SuperWEB2 with a user account that belongs to the relevant group and check the limits are being applied correctly.
Deactivate User Query Limits
Query limits are applied by SuperWEB2's rules engine. The query limit rule is activated by default.
If you do not want to have any user query limits (including the default query limits) then you can turn this rule off by editing <tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml in a text editor:
Locate the following section of RulesEngine.xml:
Add comments around the
GroupQueryLimitRuleto deactivate it:
Save your changes to the file.
Restart Tomcat or the SuperWEB2 service to apply the change to RulesEngine.xml.
This change is not recommended for production use, as it will deactivate the default query limits, in addition to the user/group specific query limits. If you just want to turn off all user/group limits, then it is better to leave the rule active in RulesEngine.xml and use the following command in SuperADMIN instead:
This will remove all defined group query limits, but will leave the default limits in place.