Skip to content

HOME PAGE ... FOR takes a user role, but the docs say module role — the documented value writes an unloadable project #1001

Description

@mlehane1

Summary

The role-specific home page clause takes a user role, but the documentation says module role and its example passes one. Passing the documented value writes a project mx.exe cannot load.

Part IV Navigation Profiles gives the syntax as [HOME PAGE <Module>.<Page> FOR <Module>.<Role>], and Home Pages and Menus says in prose: "Use HOME PAGE … FOR to direct users to different pages based on their module role", with the example HOME PAGE MyModule.AdminDashboard FOR MyModule.Administrator.

Repro

On a fresh mxcli new … --version 11.13.0 app:

CREATE OR REPLACE NAVIGATION Responsive
  HOME PAGE MyFirstModule.Home
  HOME PAGE MyFirstModule.AdminHome FOR MyFirstModule.Administrator;   -- a MODULE role, as documented

then mx.exe check <app>.mpr.

Actual

Apply reports Navigation profile 'Responsive' updated., exit 0. Then:

ERROR: Mendix.Modeler.Storage.StorageLoadException: One or more invalid values were detected
 - Role based home page in  has an invalid value '' for property UserRole.
   The text 'MyFirstModule.Administrator' is not a valid UserRoleIdentifier.

The module-role qualified name is written into a slot Mendix reads as a UserRoleIdentifier. As with the NOT FOUND PAGE issue, there is no The app contains: N errors. line — the project fails to load.

The working form

A bare user role name:

HOME PAGE MyFirstModule.AdminHome FOR Administrator;   -- mx check: 0 errors

Isolated with a control

On a fresh copy at 0 errors, one clause apart:

step result
baseline 0 errors
same statement without the FOR clause 0 errors (unchanged)
+ FOR MyFirstModule.Administrator (module role, as documented) project will not load
FOR Administrator (user role) instead 0 errors

Two things here

  1. The value is not validated. mxcli already performs exactly this check for ALTER PROJECT SECURITY GUEST ACCESS ON ROLE <r> — it refuses a role name that is not among the project's user roles, and says so clearly. The same validation applied here would turn an unloadable project into a clear error message.
  2. The documentation points at the wrong kind of role, including in its worked example, so following it is what produces the broken state.

Environment

mxcli 0.19.0 / Mendix 11.13.0. Recovery is headless — re-run the statement with a valid user role, or without the clause.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions