Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Demo Users

Demo users are test accounts created for development and testing. They appear on the login screen when demo users are enabled, allowing quick access without manual user setup.

CREATE DEMO USER

CREATE DEMO USER '<username>' (
  Password: '<password>',
  [Entity: <Module>.<Entity>,]
  UserRoles: (<UserRole> [, ...])
);
ParameterDescription
<username>Login name for the demo user
PasswordPassword (visible in development only)
EntityOptional. The entity that generalizes System.User (e.g., Administration.Account). If omitted, the system auto-detects the unique System.User subtype.
UserRolesThe project-level user roles to assign

The keys are Studio Pro’s property names. The clause form PASSWORD '<password>' [ENTITY <Module>.<Entity>] (<UserRole>, …) is the deprecated alias of the list (MDL-DEPR137); mxcli fmt --upgrade rewrites it.

Examples

mdl 1;
-- Basic demo user
CREATE DEMO USER 'demo_admin' ( Password: 'Admin123!', UserRoles: (Administrator) );

-- With explicit entity
CREATE DEMO USER 'demo_admin' ( Password: 'Admin123!', Entity: Administration.Account, UserRoles: (Administrator) );

-- Multiple roles
CREATE DEMO USER 'demo_manager' ( Password: 'Manager1!', UserRoles: (Manager, Reporting) );

-- Standard user
CREATE DEMO USER 'demo_user' ( Password: 'User1234!', UserRoles: (Employee) );

DROP DEMO USER

DROP DEMO USER '<username>';

Example:

DROP DEMO USER 'demo_admin';

Enabling Demo Users

Demo users only appear on the login screen when enabled in project security:

ALTER APP SECURITY ( EnableDemoUsers: TRUE );

To hide them:

ALTER APP SECURITY ( EnableDemoUsers: FALSE );

Listing Demo Users

LIST DEMO USERS;

Typical Setup

mdl 1;
-- Enable demo users and set prototype security
ALTER APP SECURITY ( SecurityLevel: PROTOTYPE );
ALTER APP SECURITY ( EnableDemoUsers: TRUE );

-- Create demo accounts for each role
CREATE DEMO USER 'demo_admin' ( Password: 'Admin123!', Entity: Administration.Account, UserRoles: (Administrator) );
CREATE DEMO USER 'demo_user' ( Password: 'User1234!', Entity: Administration.Account, UserRoles: (Employee) );
CREATE DEMO USER 'demo_guest' ( Password: 'Guest123!', Entity: Administration.Account, UserRoles: (Guest) );

See Also