Skip to main content
Skip table of contents

Prevent Guest Users from Creating Large Tables - SuperWEB2

If you decide to allow guest user access on your system , you may wish to restrict guest users from creating large tables, and thus prevent guest users from accessing large table mode .

To prevent guest users from creating large tables, you need to edit <tomcat_home>\webapps\webapi\WEB-INF\data\.repository\RulesEngine.xml

  1. Open the file in a text editor.

    Make a backup copy of this file before making any changes.

  2. Locate the following section (which is commented out by default):

    XML
         <!--
        <rules:EditRule name="GuestUserCellLimitRule"
                applicableOperations="all"
                implClassName="au.com.str.webapi.services.database.manager.rules.impl.GuestUserCellLimitRule">
            <rules:impl-class-init>
                <rules:init-param name="limit" value="200"/>
            </rules:impl-class-init>
        </rules:EditRule>
        -->
  3. Remove the comments around the rule:

    XML
        <rules:EditRule name="GuestUserCellLimitRule"
                applicableOperations="all"
                implClassName="au.com.str.webapi.services.database.manager.rules.impl.GuestUserCellLimitRule">
            <rules:impl-class-init>
                <rules:init-param name="limit" value="200"/>
            </rules:impl-class-init>
        </rules:EditRule>
        
  4. (Optionally) change the value of the limit parameter to the maximum cell count you want to allow for guest users (the default is 200). For example:

    XML
            <rules:impl-class-init>
                <rules:init-param name="limit" value="300"/>
            </rules:impl-class-init>

    If you want to prevent guest users from accessing large table mode, make sure that you set this limit below the large table mode thresholds you set in CubeCatalog.xml (see Configure Settings for Large Tables - SuperWEB2 for more details).

  5. Locate the following section of the file:

    XML
        <rules:RulesPipe name="CDataOnlineEditRules">
            <!-- <rules:rule-name name="OverrideDefaultSummationRule"/>    -->
            <!-- <rules:rule-name name="MandatoryFieldsRule"/> -->
            <!-- <rules:rule-name name="DBSummationOptionsRule"/> -->
            <!-- <rules:rule-name name="GuestUserCellLimitRule"/> -->
            <rules:rule-name name="DemographicVariablesRule"/>
            <rules:rule-name name="TableCellsNumberRule"/>
  6. Activate the rule, by removing the comments from around the <rules:rule-name name="GuestUserCellLimitRule"/> line.

    XML
        <rules:RulesPipe name="CDataOnlineEditRules">
            <!-- <rules:rule-name name="OverrideDefaultSummationRule"/>    -->
            <!-- <rules:rule-name name="MandatoryFieldsRule"/> -->
            <!-- <rules:rule-name name="DBSummationOptionsRule"/> -->
            <rules:rule-name name="GuestUserCellLimitRule"/>
            <rules:rule-name name="DemographicVariablesRule"/>
            <rules:rule-name name="TableCellsNumberRule"/>
  7. Save your changes to the file.
  8. Restart Tomcat or the SuperWEB2 service.

Optional Step: Edit the Message Displayed to Guest Users

As an optional additional step, you can modify the text of the error message that is displayed if a guest user tries to create a table above this threshold.

The default error message is:

To change the message, you need to edit <tomcat_home>\webapps\webapi\WEB-INF\classes\CDataOnlineEditRules.properties

There may be multiple copies of this file for different languages and locales, with names like CDataOnlineEditRules_de.properties and CDataOnlineEditRules_ru.properties. Each one contains the text used for different languages. Depending on which languages are in use on your deployment, you may need to make these changes in multiple versions of the file. The properties file that is used will depend on the language settings in the end user's web browser, the set of supported locales defined in the faces-config.xml configuration file, and the language selected by the user from the drop-down list . See Multilingual and Localisation Support - SuperWEB2 for more information about localisation and how SuperWEB2 uses the properties files. 

  1. Open the file in a text editor.

    Make a backup copy of this file before making any changes.

  2. Locate the following line:

    TEXT
    GuestLimitCellLimiteExceeded=Table too large for guest mode.
  3. Change the text to your preferred error message. For example:

    TEXT
    GuestLimitCellLimiteExceeded=Table too large for guest mode. Please login to your account to create large tables.
  4. Save your changes and restart Tomcat or the SuperWEB2 service.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.