diff --git a/docs/4DQodlyPro/roles/img/restric-mode.png b/docs/4DQodlyPro/roles/img/restric-mode.png new file mode 100644 index 000000000..8728fdf8a Binary files /dev/null and b/docs/4DQodlyPro/roles/img/restric-mode.png differ diff --git a/docs/4DQodlyPro/roles/permissionsOverview.md b/docs/4DQodlyPro/roles/permissionsOverview.md index d22050c05..e4cdc830a 100644 --- a/docs/4DQodlyPro/roles/permissionsOverview.md +++ b/docs/4DQodlyPro/roles/permissionsOverview.md @@ -5,14 +5,12 @@ title: Overview import Column from '@site/src/components/Column' -In managing access control within your application, understanding the hierarchy and how permissions can override one another is crucial. Permissions can be set at various levels—**Datastore**, **DataClass**, and **Attribute**—each with the ability to override or supplement permissions set at higher levels. This hierarchical structure allows for granular control over user access to resources. - +A permission is the ability to do an action on a resource. For example, *execute the `ds.myTable.myFunction()`* represents a permission. Each permission can be given to one or more privileges. -## Permissions +When no specific permission has been defined for a resource, access to the resource may be automatically unrestricted or restricted depending on the [default mode](#default-restriction-modes) defined for the project. -The permissions grid provides a comprehensive interface for managing access control. -### Permission Types +## Permission Types Permissions define essential actions on resources, covering tasks such as creation, reading, updating, deletion, description, execution (for functions), and promotion (also for functions). @@ -25,6 +23,22 @@ Permissions define essential actions on resources, covering tasks such as creati | Execute | Execute all functions throughout the Model, including DataStore, Dataclasses, Entity selections, Entities, as well as Singleton functions| Execute any function on the chosen dataclass (Dataclass functions, entity functions, and entity selection functions). | n/a | Execute the selected function. | | Promote | n/a | n/a | n/a | Temporarily adds a specific privilege to the session during function execution, primarily for secure privilege escalation. | + +## Default restriction modes + +The **Restrict Access by default** selector allows you to configure how resources (i.e. datastore, attributes, functions, etc.) are accessed when no specific permission is defined for them: + + + +- **Unrestricted mode** (selector off): Resources without defined permissions are accessible to all requests. This mode is suitable for development environments where access can be gradually restricted. +- **Restricted mode** (selector on): Resources without defined permissions are blocked by default. This mode is recommended for production environments where access must be explicitly granted. + +For more information on the restriction modes, please refer to the [4D documentation](https://developer.4d.com/docs/ORDA/privileges#restriction-modes/). + +## Managing permissions + +The permissions grid provides a comprehensive interface for managing access control. + ### Search Functionality The search bar allows users to quickly locate permissions by typing keywords. The search dynamically narrows the list of displayed permissions based on the input. @@ -104,6 +118,9 @@ When all resources are available, the Clean button is disabled. +

@@ -169,23 +169,6 @@ To assign a role to a user in the `development` environment: -## Retrieving Current Session Information - -You can retrieve user information in the current session using the `cs.Qodly.Users` class. This allows you to access essential user details, such as their email, role, first name, and last name. - -Here's how you can retrieve and store user data for session-wide access: - -```qs -exposed Function loadSessionUserInfo() - - use(session.storage) - session.storage.currentUser = cs.Qodly.Users.me.currentUser() - end - -``` - -For more detailed information, refer to the [Sessions](../../QodlyinCloud/qodlyScript/SessionClass.md) and [Users](../../QodlyinCloud/qodlyScript/UsersClass.md) sections. - ## Roles and privileges JSON Representation diff --git a/docs/QodlyinCloud/qodlyScript/guides/sessions.md b/docs/QodlyinCloud/qodlyScript/guides/sessions.md index a0ab21eec..3cfa7e69c 100644 --- a/docs/QodlyinCloud/qodlyScript/guides/sessions.md +++ b/docs/QodlyinCloud/qodlyScript/guides/sessions.md @@ -20,3 +20,22 @@ The user only has [Guest privilege](../../../4DQodlyPro/roles/datastorePermissio See [this tutorial](./login.md) for an example of custom user authentication for public access. +## Retrieving Current Session Information + +You can retrieve user information in the current session using the `cs.Qodly.Users` class. This allows you to access essential user details, such as their email, role, first name, and last name. + +Here's how you can retrieve and store user data for session-wide access: + +```qs +exposed Function loadSessionUserInfo() + + use(session.storage) + session.storage.currentUser = cs.Qodly.Users.me.currentUser() + end + +``` + +For more detailed information, refer to the [Sessions](../SessionClass.md) and [Users](../UsersClass.md) classes. + + + diff --git a/versioned_docs/version-21/4DQodlyPro/notes.md b/versioned_docs/version-21/4DQodlyPro/notes.md index 07e398f54..bb086e404 100644 --- a/versioned_docs/version-21/4DQodlyPro/notes.md +++ b/versioned_docs/version-21/4DQodlyPro/notes.md @@ -17,6 +17,17 @@ title: Release Notes ... more to come... +### Breaking changes + +Starting with version 21, custom components must be migrated to the new structure supported by the Qodly CLI. + +To migrate existing components, run the following command from the root of your project: + +```bash +npx @qodly/cli@latest migrate +``` + +Once migration is complete, rebuild your project to ensure all components load correctly in Studio. ## 4D 20 R10 diff --git "a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/Screenshot 2025-10-16 at 1.57.27\342\200\257AM.png" "b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/Screenshot 2025-10-16 at 1.57.27\342\200\257AM.png" new file mode 100644 index 000000000..0f1c6a98c Binary files /dev/null and "b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/Screenshot 2025-10-16 at 1.57.27\342\200\257AM.png" differ diff --git a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-add.png b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-add.png new file mode 100644 index 000000000..10bb4f689 Binary files /dev/null and b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-add.png differ diff --git a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-empty.png b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-empty.png new file mode 100644 index 000000000..7107c626a Binary files /dev/null and b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-empty.png differ diff --git a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-save.png b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-save.png new file mode 100644 index 000000000..7319b50cc Binary files /dev/null and b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/keyboard-shortcuts-save.png differ diff --git a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/shortcuts-setup.png b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/shortcuts-setup.png new file mode 100644 index 000000000..c48d3bb1c Binary files /dev/null and b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/img/shortcuts-setup.png differ diff --git a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/overview.md b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/overview.md index e5062403b..6936cebc9 100644 --- a/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/overview.md +++ b/versioned_docs/version-21/4DQodlyPro/pageLoaders/events/overview.md @@ -5,15 +5,12 @@ title: Overview import Column from '@site/src/components/Column' - Events serve as a mechanism for initiating specific actions, often employed to trigger particular behaviors. They collaborate with various actions to establish dynamic interactions within an application. For instance, when a user interacts with a webpage by clicking a button, you have the flexibility to determine the response, whether it involves invoking a function or opening another webpage. Furthermore, events can be activated in response to [updates in a Qodly Source](#qodly-source-events). Within Qodly Studio, events play a pivotal role in executing code on the Qodly web server, without requiring any supplementary JavaScript. - - ## Types of Events Events can be set to trigger either when end-users perform specific actions or when qodlysources are updated. @@ -24,11 +21,55 @@ You can configure events to activate in response to specific actions performed b Typical user events include `On Click`, `On DblClick`, `On MouseEnter`, `On Keyup`, and others. The available events may vary depending on the selected component, and detailed documentation can be found in the **Triggers and Events section** on each component's page. +Certain events, such as **On KeyDown** and **On KeyUp**, have a dedicated configuration interface for defining **keyboard shortcuts**. This allows you to bind specific key combinations (for example, `Ctrl+S` or `Shift+⌘`) to trigger a function when those keys are pressed. + +### Opening the Shortcut Setup + +In the **Events** panel of a component, events like `On Keydown` and `On Keyup` display a small gear icon beside their function selector. +Clicking this icon opens a tooltip labeled **“Shortcuts setup”**. + +_Example:_ + +![Shortcuts setup tooltip](./img/shortcuts-setup.png) + +### Keyboard Shortcuts Dialog + +Selecting **Shortcuts setup** opens the **Keyboard Shortcuts** dialog. + +Inside the dialog, you can define one or more key combinations that will trigger the selected function. + +![Empty keyboard shortcut dialog](./img/keyboard-shortcuts-empty.png) + +- The dialog prompts: **“Press your key (Ctrl+S...)”** — this field listens for key input. +- Press the desired key combination (for example, `Shift + ⌘` on macOS). +- The detected combination appears in the input field. + +### Adding Shortcuts + +Once a key combination is entered, click the **“+”** button to add it. +Each shortcut appears below the field as a labeled chip (for example, `Shift+⌘`). + +![Adding a keyboard shortcut](./img/keyboard-shortcuts-add.png) + +You can: + +- Add multiple shortcuts. +- Remove a shortcut using the **“x”** icon next to it. +- Save your configuration by clicking **Save**. + +When a shortcut is defined, the **Save** button becomes active. + +![Shortcut added and ready to save](./img/keyboard-shortcuts-save.png) + +### Cancelling or Clearing + +If you want to discard changes or remove all shortcuts, click **Cancel**. +This will close the dialog without saving modifications. + ### Qodly Source events Besides events triggered by end-user actions, events can also be automated to respond when qodlysources undergo changes. Qodly Sources support two distinct events: the `On Change` event and the `On Init` event. - #### On Init The `On Init` event is triggered when the Qodly Source is instantiated by the renderer. It provides an opportunity to set up an initial value for the Qodly Source. Actions or function calls bound to the `On Init` event should focus solely on initializing that specific Qodly Source. @@ -37,12 +78,12 @@ The `On Init` event is triggered when the Qodly Source is instantiated by the re When the `On Change` event is linked to a Qodly Source, it will trigger in the following scenarios: -|Trigger|Description| -|---|---| -|Qodly Source|
  • The reference pointed to by the qodlysource changes in the web browser (not on the server)
  • The entity is [touched](../../../QodlyinCloud/qodlyScript/EntityClass.md#touched)
  • | -|Entity Qodly Source|The contents of the entity attribute change| -|Entity Selection Qodly Source|
  • The reference pointed by the qodlysource changes in the web browser (not on the server)
  • An entity is added to the entity selection
  • | -|Scalar Qodly Source|The contents of the scalar qodlysource change| +| Trigger | Description | +| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Qodly Source |
  • The reference pointed to by the qodlysource changes in the web browser (not on the server)
  • The entity is [touched](../../../QodlyinCloud/qodlyScript/EntityClass.md#touched)
  • | +| Entity Qodly Source | The contents of the entity attribute change | +| Entity Selection Qodly Source |
  • The reference pointed by the qodlysource changes in the web browser (not on the server)
  • An entity is added to the entity selection
  • | +| Scalar Qodly Source | The contents of the scalar qodlysource change | ## Circular Dependency Risk @@ -63,4 +104,3 @@ This creates a loop: Change → On Change Event → Reload Standard Action → Change → On Change Event → Reload Standard Action → ... This loop continues indefinitely until Qodly Studio runs out of resources or crashes, leading to the application freezing. - diff --git a/versioned_docs/version-21/4DQodlyPro/roles/img/restric-mode.png b/versioned_docs/version-21/4DQodlyPro/roles/img/restric-mode.png new file mode 100644 index 000000000..8728fdf8a Binary files /dev/null and b/versioned_docs/version-21/4DQodlyPro/roles/img/restric-mode.png differ diff --git a/versioned_docs/version-21/4DQodlyPro/roles/permissionsOverview.md b/versioned_docs/version-21/4DQodlyPro/roles/permissionsOverview.md index d22050c05..e4cdc830a 100644 --- a/versioned_docs/version-21/4DQodlyPro/roles/permissionsOverview.md +++ b/versioned_docs/version-21/4DQodlyPro/roles/permissionsOverview.md @@ -5,14 +5,12 @@ title: Overview import Column from '@site/src/components/Column' -In managing access control within your application, understanding the hierarchy and how permissions can override one another is crucial. Permissions can be set at various levels—**Datastore**, **DataClass**, and **Attribute**—each with the ability to override or supplement permissions set at higher levels. This hierarchical structure allows for granular control over user access to resources. - +A permission is the ability to do an action on a resource. For example, *execute the `ds.myTable.myFunction()`* represents a permission. Each permission can be given to one or more privileges. -## Permissions +When no specific permission has been defined for a resource, access to the resource may be automatically unrestricted or restricted depending on the [default mode](#default-restriction-modes) defined for the project. -The permissions grid provides a comprehensive interface for managing access control. -### Permission Types +## Permission Types Permissions define essential actions on resources, covering tasks such as creation, reading, updating, deletion, description, execution (for functions), and promotion (also for functions). @@ -25,6 +23,22 @@ Permissions define essential actions on resources, covering tasks such as creati | Execute | Execute all functions throughout the Model, including DataStore, Dataclasses, Entity selections, Entities, as well as Singleton functions| Execute any function on the chosen dataclass (Dataclass functions, entity functions, and entity selection functions). | n/a | Execute the selected function. | | Promote | n/a | n/a | n/a | Temporarily adds a specific privilege to the session during function execution, primarily for secure privilege escalation. | + +## Default restriction modes + +The **Restrict Access by default** selector allows you to configure how resources (i.e. datastore, attributes, functions, etc.) are accessed when no specific permission is defined for them: + + + +- **Unrestricted mode** (selector off): Resources without defined permissions are accessible to all requests. This mode is suitable for development environments where access can be gradually restricted. +- **Restricted mode** (selector on): Resources without defined permissions are blocked by default. This mode is recommended for production environments where access must be explicitly granted. + +For more information on the restriction modes, please refer to the [4D documentation](https://developer.4d.com/docs/ORDA/privileges#restriction-modes/). + +## Managing permissions + +The permissions grid provides a comprehensive interface for managing access control. + ### Search Functionality The search bar allows users to quickly locate permissions by typing keywords. The search dynamically narrows the list of displayed permissions based on the input. @@ -104,6 +118,9 @@ When all resources are available, the Clean button is disabled. +

    @@ -169,23 +169,6 @@ To assign a role to a user in the `development` environment: -## Retrieving Current Session Information - -You can retrieve user information in the current session using the `cs.Qodly.Users` class. This allows you to access essential user details, such as their email, role, first name, and last name. - -Here's how you can retrieve and store user data for session-wide access: - -```qs -exposed Function loadSessionUserInfo() - - use(session.storage) - session.storage.currentUser = cs.Qodly.Users.me.currentUser() - end - -``` - -For more detailed information, refer to the [Sessions](../../QodlyinCloud/qodlyScript/SessionClass.md) and [Users](../../QodlyinCloud/qodlyScript/UsersClass.md) sections. - ## Roles and privileges JSON Representation diff --git a/versioned_docs/version-21/QodlyinCloud/qodlyScript/guides/sessions.md b/versioned_docs/version-21/QodlyinCloud/qodlyScript/guides/sessions.md index a0ab21eec..3cfa7e69c 100644 --- a/versioned_docs/version-21/QodlyinCloud/qodlyScript/guides/sessions.md +++ b/versioned_docs/version-21/QodlyinCloud/qodlyScript/guides/sessions.md @@ -20,3 +20,22 @@ The user only has [Guest privilege](../../../4DQodlyPro/roles/datastorePermissio See [this tutorial](./login.md) for an example of custom user authentication for public access. +## Retrieving Current Session Information + +You can retrieve user information in the current session using the `cs.Qodly.Users` class. This allows you to access essential user details, such as their email, role, first name, and last name. + +Here's how you can retrieve and store user data for session-wide access: + +```qs +exposed Function loadSessionUserInfo() + + use(session.storage) + session.storage.currentUser = cs.Qodly.Users.me.currentUser() + end + +``` + +For more detailed information, refer to the [Sessions](../SessionClass.md) and [Users](../UsersClass.md) classes. + + +