Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/4DQodlyPro/roles/img/restric-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions docs/4DQodlyPro/roles/permissionsOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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:

<img src={require('./img/restric-mode.png').default} style={{borderRadius: '6px'}} />

- **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 <img src={require('./img/searchPermissions.png').default} style={{borderRadius: '6px', width:'30%'}} /> allows users to quickly locate permissions by typing keywords. The search dynamically narrows the list of displayed permissions based on the input.
Expand Down Expand Up @@ -104,6 +118,9 @@ When all resources are available, the Clean button is disabled. <img src={requi

## Inheritance

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.


### General Principle

The permissions hierarchy is structured as follows:
Expand Down
19 changes: 1 addition & 18 deletions docs/4DQodlyPro/roles/rolesPrivilegesOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ To add a privilege:
3. Click on the `Privileges` tab to access privileges management.
4. Click on the `+` button to create a new privilege.

<img src={require('./img/addPrivilege.png').default} style={{borderRadius: '6px'}} />
<img src={require('./img/addPrivilege.png').default} style={{borderRadius: '6px', width:'50%'}} />

<br/><br/>

Expand Down Expand Up @@ -169,23 +169,6 @@ To assign a role to a user in the `development` environment:
<img src={require('./img/addingRolesviaCloud.png').default} style={{borderRadius: '6px'}} />


## 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
Expand Down
19 changes: 19 additions & 0 deletions docs/QodlyinCloud/qodlyScript/guides/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.



11 changes: 11 additions & 0 deletions versioned_docs/version-21/4DQodlyPro/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 51 additions & 11 deletions versioned_docs/version-21/4DQodlyPro/pageLoaders/events/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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|<li>The reference pointed to by the qodlysource changes in the web browser (not on the server)</li><li>The entity is [touched](../../../QodlyinCloud/qodlyScript/EntityClass.md#touched)</li>|
|Entity Qodly Source|The contents of the entity attribute change|
|Entity Selection Qodly Source| <li>The reference pointed by the qodlysource changes in the web browser (not on the server)</li><li>An entity is added to the entity selection</li>|
|Scalar Qodly Source|The contents of the scalar qodlysource change|
| Trigger | Description |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Qodly Source | <li>The reference pointed to by the qodlysource changes in the web browser (not on the server)</li><li>The entity is [touched](../../../QodlyinCloud/qodlyScript/EntityClass.md#touched)</li> |
| Entity Qodly Source | The contents of the entity attribute change |
| Entity Selection Qodly Source | <li>The reference pointed by the qodlysource changes in the web browser (not on the server)</li><li>An entity is added to the entity selection</li> |
| Scalar Qodly Source | The contents of the scalar qodlysource change |

## Circular Dependency Risk

Expand All @@ -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.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions versioned_docs/version-21/4DQodlyPro/roles/permissionsOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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:

<img src={require('./img/restric-mode.png').default} style={{borderRadius: '6px'}} />

- **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 <img src={require('./img/searchPermissions.png').default} style={{borderRadius: '6px', width:'30%'}} /> allows users to quickly locate permissions by typing keywords. The search dynamically narrows the list of displayed permissions based on the input.
Expand Down Expand Up @@ -104,6 +118,9 @@ When all resources are available, the Clean button is disabled. <img src={requi

## Inheritance

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.


### General Principle

The permissions hierarchy is structured as follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ To add a privilege:
3. Click on the `Privileges` tab to access privileges management.
4. Click on the `+` button to create a new privilege.

<img src={require('./img/addPrivilege.png').default} style={{borderRadius: '6px'}} />
<img src={require('./img/addPrivilege.png').default} style={{borderRadius: '6px', width:'50%'}} />

<br/><br/>

Expand Down Expand Up @@ -169,23 +169,6 @@ To assign a role to a user in the `development` environment:
<img src={require('./img/addingRolesviaCloud.png').default} style={{borderRadius: '6px'}} />


## 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.