diff --git a/en/building-sites/client-proofing/custom-manager-themes.md b/en/building-sites/client-proofing/custom-manager-themes.md index 41b0492c7..f9d550994 100644 --- a/en/building-sites/client-proofing/custom-manager-themes.md +++ b/en/building-sites/client-proofing/custom-manager-themes.md @@ -1,21 +1,60 @@ --- title: "Custom Manager Themes" -_old_id: "365" -_old_uri: "2.x/administering-your-site/customizing-the-manager/manager-templates-and-themes" +description: "Override the files of the MODX Manager with a theme of your own: how the theme is chosen, what it has to contain, and how to override a single file or a controller." --- -**Heads up**: when you use custom Manager theme you need to check that everything still works as expected after upgrading MODX. A custom Manager theme can conflict with or be missing important core changes that come in new MODX releases. +> [!IMPORTANT] +> Check a custom manager theme after every upgrade of MODX. A theme can conflict with the changes of a new release, and the files that a release adds are never picked up by the theme. -The MODX Manager uses a template similar to regular MODX pages. By default, the Manager template files live inside the `manager/templates/default` directory. By updating the MODX system setting for `manager\_theme` to point to a new directory, you can override any single file by copying its directory structure and adding just the templates you wish to override. You can override as few or as many templates as you desire, as long as you maintain identical directory layouts. The Manager will fall back to the `default` theme templates for any that have not been overridden. +## How a Theme Works -For example, to customize only the Manager Login page, you copy the following file into a new directory: +The manager is built on Smarty templates. The default theme's files live in `manager/templates/default`. The system setting `manager_theme` holds a directory name inside `manager/templates/`. The manager reads that theme's files first, and falls back to `default` for every file the theme does not have. ->manager/templates/default/security/login.tpl +Only the `default` theme ships with MODX 3. Other themes come with a build, an extra, or your own files. -To create a custom Manager login theme called **my-brand**, copy that file into a new directory: +The theme covers more than the manager pages. Dashboard widget templates, TV templates, and Resource controllers are resolved from it as well. ->manager/templates/**my-brand**/security/login.tpl +## Overriding a Single File -Then update your system setting for `manager\_theme` to point to the newly created `my-brand` directory. The version of the file from the `my-brand` directory will override the version of the file from the default directory. +To theme only the manager login page, copy the file: -While far less common, you can similarly override the Controllers in the same way, replacing "templates" with "controllers" per above. If you don't know what that means, you don’t need to do so. +`manager/templates/default/security/login.tpl` → `manager/templates/my-brand/security/login.tpl` + +Then set `manager_theme` to `my-brand`. The file from `my-brand` wins over the file from `default`. + +**Create the directory before you pick the theme** +The setting is a combo box that lists the directories of `manager/templates/`, and it cannot be typed by hand. Create `manager/templates/my-brand/` first, then pick it in **Admin → System Settings**. + +## What a Theme Has to Carry + +These files are read from the directory of the theme, with no fallback to `default`: + +| File | What breaks without it | +| --- | --- | +| `images/modx-icon-color.svg` | The icon of the site in the header of the manager. | +| `images/modx-logo-color.svg` | The logo on the login page. | +| `images/login/default-background.jpg` | The background of the login page. | +| `email/default.tpl` | Creating a user: the template of the letter is not found. | + +**The login page stylesheet is not themed** +`security/login.tpl` links the `default` theme's stylesheet by a fixed path. To theme it, put `css/login.css` into the theme directory and fix the link in your copy of `security/login.tpl`. The same holds for the file browser: its `browser/index.tpl` links the `default` theme's `css/index.css`. + +The manager stylesheet is themed. Put `css/index.css` into the theme directory, and the header picks it up through the `{$indexCss}` placeholder. + +## Where the Theme Has to Live + +The theme directory is resolved inside `manager/templates/`, which is part of the installation and is overwritten by an update. Keep the theme files in a repository of your own and restore them after an update. + +**An update from Evolution resets the theme** +When the installer upgrades a site from Evolution, `setup/includes/upgrade.install.php` sets `manager_theme` back to `default`. An update inside MODX 3 leaves the setting as it is. + +## Overriding a Controller + +A controller is overridden the same way, with `controllers` in place of `templates`. The file in the theme must have the same name as in `default` (`.class.php`). The class inside it must be named `ManagerController` in the global namespace, for example `SecurityLoginManagerController`. + +## See Also + +1. [Client-proofing the manager](building-sites/client-proofing) +2. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) +3. [Customizing the Login](building-sites/client-proofing/manager-login) +4. [Dashboards](building-sites/client-proofing/dashboards) diff --git a/en/building-sites/client-proofing/dashboards/creating-a-widget.md b/en/building-sites/client-proofing/dashboards/creating-a-widget.md index e1c874481..4a6dc4228 100644 --- a/en/building-sites/client-proofing/dashboards/creating-a-widget.md +++ b/en/building-sites/client-proofing/dashboards/creating-a-widget.md @@ -1,25 +1,26 @@ --- title: "Creating a Dashboard Widget" -_old_id: "69" -_old_uri: "2.x/administering-your-site/dashboards/creating-a-dashboard-widget" +description: "Create a Dashboard Widget in MODX: the fields of a widget, the sizes it takes, and how to put it on a Dashboard." --- -This article describes how to create a custom Dashboard Widget, including a short description of the different Dashboard Widget types and how they work. - ## Creating a Basic Widget -Go to the Dashboards page (Dashboard -> Dashboards in the top menu), and click on the "Widgets" tab. Then, click on "Create New Widget", and this will load the Widget creation screen. You'll see a few new fields: +Go to the Dashboards page (**Admin → Dashboards** in the top menu), and click on the "Widgets" tab. Then click **Create**, and the Widget creation screen loads. It has these fields: -- **Name** - The name of your new widget. Let's call ours "Hello World". -- **Description** - A short description of your widget, used internally. -- **Widget Type** - The type of Widget. We'll get into this more later, but for now, just select "HTML". -- **Size** - Widgets come in 3 sizes - half, full, and double. A half-sized widget takes up half of one row. A full takes up one whole row. A double takes up 2 rows. -- **Namespace** - The Namespace to associate the widget with. Useful for Extras developers; but for us, let's keep it at "core". -- **Lexicon** - Adds an ability to load a lexicon with this widget. Let's go ahead and leave ours at "core:dashboards", the default setting. +| Field | What it holds | +| --- | --- | +| **Name** | The name of the widget. It must be unique. | +| **Description** | A short description of the widget, used internally. | +| **Widget Type** | The type of the widget. For a first widget, select "HTML". | +| **Size** | One of seven sizes: Quarter, One Third, Half, Two Third, Three Quarters, Full Size and Double Size. | +| **Permission** | The manager permission a user needs for the widget to appear. Empty means the widget is shown to everyone. | +| **Namespace** | The Namespace to associate the widget with. Leave it at "core" unless you build an Extra. | +| **Lexicon** | The lexicon to load with the widget. The default is "core:dashboards". | +| **Properties** | Arbitrary properties of the widget, stored as JSON. A file or a snippet widget receives them as `$scriptProperties`. | -You'll note that as you type the name of the widget, text appears below it following what you type. This is the automatic translation tool for Widget names; if you were to type a Lexicon Entry key, it would translate it (try typing "widget\_create" for kicks to see what it does). +As you type the name, a translated version of it appears below the field. The translation looks up the key in the lexicon of the widget. Type the key of an existing entry, for example `w_configcheck`, and it shows the translated name of that entry. -Now, in your dashboard widget content, go ahead and put this: +Now, in the content of the widget, put this: ``` php

Hello, world!

@@ -29,13 +30,13 @@ Our widget should look like this: ![](dashboard-create1.png) -Go ahead and save the Widget. +Save the widget. ### Assigning the Widget to the Default Dashboard -Now that we've got our widget, let's assign it to the Default Dashboard, by going back to the main Dashboards page, clicking on the "Dashboards" tab, and finding the default Dashboard. Right-click on it, and click "Update Dashboard". This will load the Default Dashboard editing page. +To assign the widget to the Default Dashboard, go back to the main Dashboards page, click on the "Dashboards" tab, and find the Default Dashboard. Right-click on it and click "Edit". This loads the editing page of the Default Dashboard. -From here, click the "Place Widget" button above the Widgets grid on this page. Select our "Hello World" widget from the dropdown, and click save. Now our Widget is on the Dashboard! Let's go ahead and place it in position #2 by dragging it between the "Configuration Check" widget and the "MODX News Feed" widget: +From here, click the "Place Widget" button above the Widgets grid on this page. Select the "Hello World" widget from the dropdown, and click save. To place it in position #2, drag it between the "Configuration Check" widget and the "MODX News Feed" widget: ![](dashboard-create2.png) @@ -45,24 +46,31 @@ Save your Dashboard. > > Adding a widget directly on the dashboard page (via the dashboard view itself) only adds it for the currently logged-in user. Other users will not see it unless it is also added to the template. > -> On large sites with many users, adding a widget to the template will create a placement record for each user who already has a personal copy of that dashboard. Keep this in mind if performance is a concern. +> A widget that is added to the template arrives at the existing users with the default size and at the end of the list. +> +> On large sites with many users, adding a widget to the template creates a placement record for every user with a personal copy of that dashboard. Keep this in mind if performance is a concern. ### Viewing the Widget -Now, if you click the "Dashboard" top menu item on the page, you can see your new dashboard widget in place! +Now, if you click the MODX logo in the top left, you can see your new dashboard widget in place! ![](dashboard-create3.png) +## Removing a Widget + +A widget is removed from the Widgets tab, and that removes it from all the Dashboards it was placed on. The widgets that ship with MODX cannot be removed. + ## Other Widget Types -Obviously, there are more widget types to create. See the [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types "Dashboard Widget Types") section for more information on creating different types of widgets. +See the [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types "Dashboard Widget Types") section for the other types of widgets. ## See Also -1. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) -2. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) -3. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) +1. [Dashboards](building-sites/client-proofing/dashboards) +2. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) +3. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) +4. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) diff --git a/en/building-sites/client-proofing/dashboards/index.md b/en/building-sites/client-proofing/dashboards/index.md index 162ea67a6..2ad3a4ba6 100644 --- a/en/building-sites/client-proofing/dashboards/index.md +++ b/en/building-sites/client-proofing/dashboards/index.md @@ -1,48 +1,65 @@ --- title: "Dashboards" -_old_id: "90" -_old_uri: "2.x/administering-your-site/dashboards" +description: "The Dashboard of MODX: the widgets on the page a user sees after logging in, the core widgets, and the personal copy each user gets." --- -## What are Dashboards? +## What a Dashboard Is -A Dashboard in MODX is the page that shows on initial loading of the MODX manager, or when clicking the "Dashboard" link in the top-left of the screen. Dashboards can contain an unlimited number of "widgets", which are boxes that show various content on the Dashboard. Widgets can be arranged in any order, and can be either a file, a MODX Snippet, or straight HTML. +A Dashboard is the page that opens when a user logs in to the manager. The MODX logo in the top left leads to it as well. -Each User Group in MODX is assigned a Dashboard by default. This means that you can give different Users different Dashboards via the User Group they belong to. +A Dashboard holds widgets: boxes with content. A widget is a file, a MODX Snippet, straight HTML, or PHP code, and the widgets can be arranged in any order. -If a User is part of two different groups, it will use the Dashboard of its Primary Group, which can be set in the User editing screen. +Each User Group is assigned a Dashboard. This is how different users get different Dashboards. If a user belongs to two groups, the Dashboard of the Primary Group is used. The Primary Group is set on the User editing screen. + +## The Core Widgets + +MODX ships seven widgets: + +| Widget | Permission | +| --- | --- | +| MODX News Feed | — | +| MODX Security Feed | — | +| Who's Online | — | +| Configuration Check | — | +| Buttons | — | +| Recently Edited Resources | `view_document` | +| Updates | `workspaces` | + +The last two are shown only to the users who hold the permission, so they are missing on the Dashboard of an ordinary user. ## Customizable Dashboards -Dashboards have a **Customizable** setting. When this is checked (the default), MODX clones the dashboard's widget layout for each user the first time they load the dashboard. This gives each user their own personal copy of the dashboard, which they can then rearrange, add widgets to, or remove widgets from without affecting other users. +A Dashboard has a **Customizable** setting. When it is on (the default), MODX clones the layout of the widgets for every user the first time they open the Dashboard. Each user then has a personal copy, which they can rearrange, add widgets to, or remove widgets from, without touching the Dashboard of anyone else. + +A user can also resize a widget on their own copy, as long as the Dashboard is customizable. + +When **Customizable** is off, all users share the same layout and cannot change it. -When **Customizable** is unchecked, all users share the same dashboard layout and cannot make personal changes to it. +A Dashboard has a second setting, **Hide Left-Hand Trees**. It hides the trees on the left while the Dashboard is shown. ### How Template Changes Propagate -The widget layout configured through the Dashboards manager page (Dashboard -> Dashboards -> Update Dashboard) serves as the **template** for a customizable dashboard. When you add or remove widgets from the template, those changes propagate to all existing users of that dashboard: +The layout configured on the Dashboards manager page serves as the **template** of a customizable Dashboard. When you add or remove widgets from the template, the changes propagate to all existing users of that Dashboard: -- **Widgets added** to the template will automatically appear for all users who already have a personal copy of the dashboard. -- **Widgets removed** from the template will be removed from all users' personal dashboards. +- **Widgets added** to the template appear for all users who already have a personal copy. +- **Widgets removed** from the template are removed from all users' personal Dashboards. -Other personal customizations, such as widget order, are not affected by template changes. +The order of the widgets is not affected by template changes. A widget added to the template arrives at the existing users with the default size, at the end of the list, not with the size of the template. -Changes made directly on a user's dashboard page (for example, removing a widget with the close button or adding a widget via the dashboard itself) only affect that individual user and do not change the template. +Changes made directly on the Dashboard of a user affect that user only and do not change the template. This covers removing a widget with the close button and adding a widget from the Dashboard itself. -## Using Dashboards +## Permissions -- [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing "Managing Your Dashboard") -- [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups "Assigning a Dashboard to a User Group") -- [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget "Creating a Dashboard Widget") -- [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types "Dashboard Widget Types") +The Dashboards page and all the actions on the widgets require the permission `dashboards`. The Dashboard itself is shown to any user who is allowed into the manager. ## See Also -1. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) -2. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) -3. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) +1. [Dashboards](building-sites/client-proofing/dashboards) +2. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) +3. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) +4. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) \ No newline at end of file + 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/en/building-sites/client-proofing/dashboards/managing.md b/en/building-sites/client-proofing/dashboards/managing.md index 8fac46002..c28150f78 100644 --- a/en/building-sites/client-proofing/dashboards/managing.md +++ b/en/building-sites/client-proofing/dashboards/managing.md @@ -1,37 +1,49 @@ --- title: "Managing Your Dashboard" -_old_id: "196" -_old_uri: "2.x/administering-your-site/dashboards/managing-your-dashboard" +description: "Edit a Dashboard in MODX: assign and arrange the widgets, create a Dashboard of your own, and keep the template of a customizable Dashboard in order." --- -This article describes how to edit a Dashboard, including on how to assign and arrange Widgets for that Dashboard. +## Editing a Dashboard -## Editing Your Dashboard +Go to the main Dashboards page, which you find in the top menu under **Admin → Dashboards**. The first tab holds a grid of the Dashboards, most likely only the "Default" one. Right-click the row and choose **Edit**. This loads the editing page of the Dashboard. -Go to the main Dashboards page, which can be found in the top menu via "Dashboard" -> "Dashboards". Once loaded, you'll notice a grid in the first tab that holds (most likely) one dashboard, the "Default" dashboard. Right-click the row, and click "Update Dashboard". This will load the editing page for the Dashboard. - -You will see a name and description field, and below, a grid of Widgets assigned to the dashboard. You can drag the widgets around to rearrange them, add widgets by clicking the "Place Widget" button, or remove widgets by right-clicking on a widget: +You see a name and a description field, and below them a grid of the widgets of the Dashboard. You can drag the widgets to rearrange them, add widgets with the **Place Widget** button, or remove them with the right mouse button: ![](dashboard-edit.png) +The name of the Default Dashboard cannot be changed in the form. The description can. It is the Dashboard every user gets when no group assigns another one. + +## Creating and Removing a Dashboard + +The page has a **Create** button, which makes a Dashboard of your own. The context menu of a Dashboard has **Duplicate** and **Delete** next to **Edit**. Duplicating a Dashboard copies its widgets and their placement; the copy is yours to change. + +The "Default" Dashboard cannot be deleted. When a Dashboard is deleted, the groups that were assigned to it fall back to the "Default" one. + +The grid of Dashboards can be filtered by a user group, which is the quickest way to find the Dashboard a certain group works with. + ## Template vs Personal Changes -Changes made on this page update the dashboard **template**. For [customizable dashboards](building-sites/client-proofing/dashboards "Dashboards"), template changes are propagated to all users who have a personal copy of that dashboard: +Changes made on this page update the Dashboard **template**. For [customizable Dashboards](building-sites/client-proofing/dashboards "Dashboards"), template changes are propagated to all users who have a personal copy of that Dashboard: - When you **add a widget** here, it will appear on the dashboard for all existing users of that dashboard. - When you **remove a widget** here, it will be removed from all users' personal dashboards. -This is different from changes made directly on the dashboard page itself (for example, using the close button on a widget or adding a widget from the dashboard view). Those changes only affect the currently logged-in user. +Changes made on the dashboard page itself are different. The close button on a widget, or adding a widget from the dashboard view, affects only the currently logged-in user. + +A widget that is added to the template arrives at the existing users with the default size and at the end of the list. + +## Permissions -If you want to enforce a widget change across all users, make it from this management page. If you only want to adjust your own dashboard, make the change directly on the dashboard page instead. +Every action on this page requires the permission `dashboards`. ## See Also -1. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) -2. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) -3. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) +1. [Dashboards](building-sites/client-proofing/dashboards) +2. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) +3. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) +4. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) \ No newline at end of file + 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/en/building-sites/client-proofing/dashboards/usergroups.md b/en/building-sites/client-proofing/dashboards/usergroups.md index 3546760e8..556e39753 100644 --- a/en/building-sites/client-proofing/dashboards/usergroups.md +++ b/en/building-sites/client-proofing/dashboards/usergroups.md @@ -1,29 +1,29 @@ --- title: "Assigning to a User Group" -_old_id: "25" -_old_uri: "2.x/administering-your-site/dashboards/assigning-a-dashboard-to-a-user-group" +description: "Assign a Dashboard to a User Group in MODX, and how the personal copy of a customizable Dashboard is made for the members of the group." --- -This article describes how to assign a Dashboard to a User Group. +Find the User Group you want to assign the Dashboard to, and edit it. The tree of the User Groups is on the page **Access → ACLs**: right-click the group in the tree and choose **Edit User Group**. -First off, find the User Group that you would like to assign the Dashboard to, and edit it. You can do so by "Menu" -> "Access Controls", then right-clicking on the group in the User Groups tree, and clicking "Update User Group". - -From there, you can simply click on the "Dashboard" dropdown, and select the Dashboard you want to assign to this User Group. All users in this group that have this group as their Primary Group will load that Dashboard instead of the Default now. +From there, click the "Dashboard" dropdown and select the Dashboard you want to assign to this User Group. All users in this group that have this group as their Primary Group will load that Dashboard instead of the Default now. ![](dashboard-assign.png) +The Dashboard is assigned in the form of the group. There is no screen that assigns a Dashboard to groups in the other direction. + ## Customizable Dashboards and User Groups -If the assigned dashboard has the **Customizable** setting checked, MODX creates a personal copy of the dashboard's widget layout for each user the first time they log in. Users can then rearrange, add, or remove widgets on their own copy without affecting other group members. +If the assigned dashboard has the **Customizable** setting checked, MODX creates a personal copy of the widget layout for each user on first login. Users can then rearrange, add, or remove widgets on their own copy without affecting other group members. -When an administrator later updates the dashboard template (by adding or removing widgets through the Dashboards manager page), those changes are applied to all existing users' personal dashboards. See [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing "Managing Your Dashboard") for more on how template changes propagate. +When an administrator later updates the dashboard template, those changes are applied to all existing users' personal dashboards. The template is edited through the Dashboards manager page. See [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing "Managing Your Dashboard") for more on how template changes propagate. ## See Also -1. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) -2. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) -3. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) +1. [Dashboards](building-sites/client-proofing/dashboards) +2. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) +3. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) +4. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) diff --git a/en/building-sites/client-proofing/dashboards/widget-types/file.md b/en/building-sites/client-proofing/dashboards/widget-types/file.md index c869bb774..fea556a44 100644 --- a/en/building-sites/client-proofing/dashboards/widget-types/file.md +++ b/en/building-sites/client-proofing/dashboards/widget-types/file.md @@ -1,13 +1,15 @@ --- title: "File" +description: "The File Dashboard Widget of MODX: the ways a file can return the content of a widget, and the variables it has available." _old_id: "85" _old_uri: "2.x/administering-your-site/dashboards/dashboard-widget-types/dashboard-widget-type-file" --- -The File Dashboard Widget Type runs a file on the filesystem, which can either: +The File Dashboard Widget Type runs a file on the filesystem. The file can return the content of the widget in three ways: -- Return the output of the file, rendering it in the content pane of the widget -- Return the name of a class that extends modDashboardWidgetInterface, a MODX-provided abstract class, that has a render() method that will return the output to render to the content pane of the widget +- Return the output of the file, which is rendered in the content pane of the widget. +- Print the output of the file and return nothing. +- Return the name of a class that extends `modDashboardWidgetInterface`, the abstract class that MODX provides for widgets. The class has a `render()` method that returns the output. ## Usage @@ -19,20 +21,34 @@ Simply place the name of the file in the content textarea of the widget. You can - `[[++assets_path]]` - `[[++manager_theme]]` +**Use an absolute path** +A relative path is resolved against the working directory of the PHP process, not against the root of MODX. It does not survive a move of the installation. Build the path from `[[++manager_path]]` and the like. + ### Returning the Output -There are two methods in your external file to return the content of the widget. The first is simply returning the output, like so: +The first way to return the content of the widget is to return the output, like so: ``` php Hello, World! Version: 1.0 diff --git a/en/building-sites/client-proofing/dashboards/widget-types/html.md b/en/building-sites/client-proofing/dashboards/widget-types/html.md index 2bb86a165..e3e191a6f 100644 --- a/en/building-sites/client-proofing/dashboards/widget-types/html.md +++ b/en/building-sites/client-proofing/dashboards/widget-types/html.md @@ -1,5 +1,6 @@ --- title: "HTML" +description: "The HTML dashboard widget of MODX: straight HTML in the content of the widget." _old_id: "86" _old_uri: "2.x/administering-your-site/dashboards/dashboard-widget-types/dashboard-widget-type-html" --- @@ -22,7 +23,7 @@ To output the username of the logged-in user. You can also call Snippets, like s [[MyDashboardSnippet]] ``` -Note that in snippets there is no "active resource", so snippets referencing `$modx->resource` will have issues. +Note that on the Dashboard there is no active resource, so a snippet that references `$modx->resource` will have issues. ## See Also diff --git a/en/building-sites/client-proofing/dashboards/widget-types/index.md b/en/building-sites/client-proofing/dashboards/widget-types/index.md index c2d74034a..d046840ee 100644 --- a/en/building-sites/client-proofing/dashboards/widget-types/index.md +++ b/en/building-sites/client-proofing/dashboards/widget-types/index.md @@ -1,23 +1,20 @@ --- title: "Widget Types" -_old_id: "89" -_old_uri: "2.x/administering-your-site/dashboards/dashboard-widget-types" +description: "The types of Dashboard Widget in MODX and the value each of them is stored with." --- -This article lists the different types of Dashboard Widgets that are available. +A Dashboard Widget holds its content in one of four types. The type is stored with the widget, and the value matters when you write the widget yourself. + +| Type | What it does | Stored value | +| --- | --- | --- | +| [File](building-sites/client-proofing/dashboards/widget-types/file "Dashboard Widget Type - File") | Runs a file from the filesystem. | `file` | +| [Snippet](building-sites/client-proofing/dashboards/widget-types/snippet "Dashboard Widget Type - Snippet") | Runs a MODX Snippet. | `snippet` | +| [HTML](building-sites/client-proofing/dashboards/widget-types/html "Dashboard Widget Type - HTML") | Shows straight HTML. | `html` | +| [Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php "Dashboard Widget Type - Inline PHP") | Runs PHP code, like a Snippet. | `php` | + +## See Also 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) - -## See Also - -1. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing) -2. [Assigning a Dashboard to a User Group](building-sites/client-proofing/dashboards/usergroups) -3. [Creating a Dashboard Widget](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Dashboard Widget Types](building-sites/client-proofing/dashboards/widget-types) - 1. [Dashboard Widget Type - File](building-sites/client-proofing/dashboards/widget-types/file) - 2. [Dashboard Widget Type - HTML](building-sites/client-proofing/dashboards/widget-types/html) - 3. [Dashboard Widget Type - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Dashboard Widget Type - Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/en/building-sites/client-proofing/dashboards/widget-types/inline-php.md b/en/building-sites/client-proofing/dashboards/widget-types/inline-php.md index 89ec33bd6..d57e3b81b 100644 --- a/en/building-sites/client-proofing/dashboards/widget-types/inline-php.md +++ b/en/building-sites/client-proofing/dashboards/widget-types/inline-php.md @@ -1,27 +1,28 @@ --- title: "Inline PHP" +description: "The Inline PHP Dashboard Widget of MODX: PHP code that runs like a Snippet, and the rules it has to follow." _old_id: "87" _old_uri: "2.x/administering-your-site/dashboards/dashboard-widget-types/dashboard-widget-type-inline-php" --- - The Inline PHP widget acts very similar to the [Snippet Widget](building-sites/client-proofing/dashboards/widget-types/snippet "Dashboard Widget Type - Snippet"), except it runs the content of the widget as if it were a Snippet. +The Inline PHP widget runs the content of the widget as if it were a [Snippet Widget](building-sites/client-proofing/dashboards/widget-types/snippet "Dashboard Widget Type - Snippet"). The difference is the code: PHP instead of a call to a Snippet. ## Usage - Simply place your PHP code in the content panel, and return the output of your widget. +Simply place your PHP code in the content panel, and return the output of your widget. - For example, this will display "Hello, World!": +For example, this will display "Hello, World!": ``` php resource` in your widget, as there is no active resource for the dashboard -- Do not put a closing PHP tag at the end of your code! For some reason, it gets parsed incorrectly (as of MODX 2.2.8) +- Use `return`, not `echo`. What you print goes into the output of the page, not into the content of the widget. +- Do not use `$modx->resource` in your widget, as there is no active resource on the Dashboard. +- The tags `` are cut off before the code runs, so a closing tag is not needed. ## See Also diff --git a/en/building-sites/client-proofing/dashboards/widget-types/snippet.md b/en/building-sites/client-proofing/dashboards/widget-types/snippet.md index 94a8a8078..d432182da 100644 --- a/en/building-sites/client-proofing/dashboards/widget-types/snippet.md +++ b/en/building-sites/client-proofing/dashboards/widget-types/snippet.md @@ -1,5 +1,6 @@ --- title: "Snippet" +description: "The Snippet dashboard widget of MODX: a snippet that returns the content of the widget." _old_id: "88" _old_uri: "2.x/administering-your-site/dashboards/dashboard-widget-types/dashboard-widget-type-snippet" --- diff --git a/en/building-sites/client-proofing/form-customization/index.md b/en/building-sites/client-proofing/form-customization/index.md index 7d04de557..5f19de861 100644 --- a/en/building-sites/client-proofing/form-customization/index.md +++ b/en/building-sites/client-proofing/form-customization/index.md @@ -1,39 +1,47 @@ --- title: "Customizing the Manager" +description: "Form Customization in MODX: the profiles, the sets and the rules that change the forms of the manager." _old_id: "83" _old_uri: "2.x/administering-your-site/customizing-the-manager" --- ## What is Form Customization? - Form Customization is a feature that allows users to create Rules, which govern how manager pages render their forms in the MODX Revolution Manager. +Form Customization lets you change the forms of the manager: hide a field, rename it, give it another value, move a TV to another tab. -## How Does it Work? +The section is under **Admin → Form Customization**, and it needs the permission `customize_forms`. - Currently, Form Customization has 3 layers: +## The Three Layers -> Profile -> Sets -> Rules +> Profile → Set → Rules - A Profile is a collection of Sets, and Sets are collections of Rules. Profiles can be restricted to specific User Groups. +A **Profile** is a collection of Sets, and it can be bound to User Groups. A **Set** is a collection of Rules, and it is bound to a page of the manager. A **Rule** is one change that the Set applies to the form. - A Set is a collection of Rules, and is tied to a certain view. Normally, you would have a Set for the Resource/Create page, and a Set for the Resource/Update page. Sets can also be tied to specific [Templates](building-sites/elements/templates "Templates") (meaning they load only when the Resource is using that Template). They can also have a 'Constraint' set, which limits the Set's execution to the restriction made in the Constraint. +The rules are not edited on their own: they are rebuilt from the three grids of the set every time the set is saved. See [Form Customization Rules](building-sites/client-proofing/form-customization/rules "Form Customization Rules"). - A Rule is all the variations applied in a Set. Rules are hidden from view in MODX Revolution, but are instead shown as fields on the Set Editing page. +## How It Is Stored - More information about each of the parts of Form Customization can be found in each part's respective page: +A profile holds sets, and a set holds its rules. The list of the fields and of the regions that can be changed is kept in a reference table. It is filled in when MODX is installed. -1. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) -2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) - 1. [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs) -3. [Manager Templates and Themes](building-sites/client-proofing/custom-manager-themes) +## Which Forms Can Be Customized -### What Forms can I Customize? +Only the pages of a resource: **Create Resource** and **Edit Resource**. The page of a chunk, a snippet, a user or a user group is not covered. - The Resource Create and Update pages can be customized at this time in Form Customization. +A set is bound to one of three actions: + +| Action | The set applies to | +| --- | --- | +| Create Resource | The page that creates a resource. | +| Edit Resource | The page that edits a resource. | +| Create & Edit Resource | Both pages at once. | + +With the last one the set covers both pages. The list of the fields and of the regions it offers comes from the page that edits a resource. ## See Also -1. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) -2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) - 1. [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs) -3. [Manager Templates and Themes](building-sites/client-proofing/custom-manager-themes) +1. [Customizing the Manager](building-sites/client-proofing/form-customization) +2. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) +3. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) + 1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) + 2. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) +4. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) diff --git a/en/building-sites/client-proofing/form-customization/profiles.md b/en/building-sites/client-proofing/form-customization/profiles.md index 3cd33bfd8..73db22244 100644 --- a/en/building-sites/client-proofing/form-customization/profiles.md +++ b/en/building-sites/client-proofing/form-customization/profiles.md @@ -1,18 +1,24 @@ --- title: "Profiles" +description: "A Form Customization profile in MODX: a collection of sets, bound to the user groups that get them." _old_id: "132" _old_uri: "2.x/administering-your-site/customizing-the-manager/form-customization-profiles" --- ## What is a Form Customization Profile? -A Profile is a collection of [Form Customization Sets](building-sites/client-proofing/form-customization/sets "Form Customization Sets"). A Profile can be restricted to only load for specific User Groups. If no User Groups are assigned, the Profile will be run for all Users. +A Profile is a collection of [Form Customization Sets](building-sites/client-proofing/form-customization/sets "Form Customization Sets"). A Profile can be restricted to load for specific User Groups. If no User Groups are assigned, the Profile runs for all Users. -It can also be marked 'inactive', which will disable its execution. +A Profile can also be marked 'inactive', which disables its execution. + +**Only the primary group of a user is matched** +By default, a profile is matched against the primary group of the user. A profile that is bound to a secondary group has no effect until the setting `form_customization_use_all_groups` is turned on. ## See Also -1. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) -2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) - 1. [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs) -3. [Manager Templates and Themes](building-sites/client-proofing/custom-manager-themes) +1. [Customizing the Manager](building-sites/client-proofing/form-customization) +2. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) +3. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) + 1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) + 2. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) +4. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) diff --git a/en/building-sites/client-proofing/form-customization/rules/field-default.md b/en/building-sites/client-proofing/form-customization/rules/field-default.md index 587caf9e5..a85b670eb 100644 --- a/en/building-sites/client-proofing/form-customization/rules/field-default.md +++ b/en/building-sites/client-proofing/form-customization/rules/field-default.md @@ -1,23 +1,26 @@ --- title: "Field Default" +description: "The Field Default rule of a Form Customization set in MODX: how it puts a value into a field of the form." _old_id: "122" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/field-default" --- -## The Field Default Rule +## What the Rule Does -The Field Default Rule, when set, will automatically set the default value of a field. +Puts a value into a field of the form of the manager. The value appears when the form opens, and it is the value the field gets if the user saves the form without changing it. -This will only work on "create" pages, **not** "update" pages. +The rule is applied on the page the set is bound to: the page that creates a resource, or the page that edits one. To have it only on the page that creates a resource, bind the set to the action **Create Resource** instead of **Create & Edit Resource**. -## Examples +## Where It Is Set -An example Rule of setting the default Category for a [Snippet](extending-modx/snippets "Snippets") for all [Users](building-sites/client-proofing/security/users "Users") in the User Group HR Department would look like this: +The **Fields** tab of the set, in the **Default Value** column. A field with a value gets the rule; an empty cell removes it. -![](fc-fielddefault1.png) +## The Template of a New Resource + +On the field `template` the rule sets the template that a new resource gets. The field is only offered when the set is bound to the action **Create Resource**. ## See Also -``` php - [[getResources@section? &parents=`122` &context=`revolution`]] - ``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/field-label.md b/en/building-sites/client-proofing/form-customization/rules/field-label.md index 0af08573e..ac3a92a59 100644 --- a/en/building-sites/client-proofing/form-customization/rules/field-label.md +++ b/en/building-sites/client-proofing/form-customization/rules/field-label.md @@ -1,21 +1,20 @@ --- title: "Field Label" +description: "The Field Label rule of a Form Customization set in MODX: how it renames a field of the form." _old_id: "123" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/field-label" --- -## The Field Label Rule +## What the Rule Does -The Field Label Rule, when set, will change a Label of a field to any text value. +Replaces the label of a field of the form with a text of your own. The field itself keeps its name and its value; only the text next to it changes. -## Examples +## Where It Is Set -An example Rule of changing the introtext's label to "Comments" for the [Users](building-sites/client-proofing/security/users "Users") in the [User Group](building-sites/client-proofing/security/user-groups "User Groups") "Marketing" would look like this: - -![](fc-fieldlabel.png) +The **Fields** tab of the set, in the **Label** column. A field with a label of its own gets the rule; an empty cell keeps the standard label of the field. ## See Also -``` php -[[getResources@section? &parents=`123` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/field-visible.md b/en/building-sites/client-proofing/form-customization/rules/field-visible.md index 65e7c85ce..49bc0621e 100644 --- a/en/building-sites/client-proofing/form-customization/rules/field-visible.md +++ b/en/building-sites/client-proofing/form-customization/rules/field-visible.md @@ -1,21 +1,28 @@ --- title: "Field Visible" +description: "The Field Visible rule of a Form Customization set in MODX: how it hides a field of the form." _old_id: "124" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/field-visible" --- -## The Field Visible Rule +## What the Rule Does -The Field Visible Rule, when set, will declare a field "visible" or not to a user. +Hides a field of the form of the manager. The field is not drawn at all, and the value of the resource in it is left alone. -## Examples +## Where It Is Set -An example Rule of hiding the introtext field from the [Users](building-sites/client-proofing/security/users "Users") in the [User Group](building-sites/client-proofing/security/user-groups "User Groups") "HR Department" would look like this: +The **Fields** tab of the set, in the **Visible** column. Clearing the checkbox of a field creates the rule; ticking it back removes the rule. -![](fc-fieldvisible.png) +## What It Applies To + +The fields of the form of the resource: + +`id`, `pagetitle`, `alias`, `longtitle`, `description`, `introtext`, `content`, `published`, `deleted`, `publishedon`, `pub_date`, `unpub_date`, `template`, `hidemenu`, `menutitle`, `link_attributes`, `menuindex`, `class_key`, `content_type`, `parent`, `content_dispo`, `isfolder`, `show_in_tree`, `hide_children_in_tree`, `alias_visible`, `uri_override`, `uri`, `richtext`, `cacheable`, `searchable`, `syncsite`. + +The list of the fields is stored in the reference table of the form, and it is filled in when MODX is installed. A database that was upgraded from 2.x may have a shorter list. ## See Also -``` php -[[getResources@section? &parents=`124` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/index.md b/en/building-sites/client-proofing/form-customization/rules/index.md index 3109c0d36..f2308e6e7 100644 --- a/en/building-sites/client-proofing/form-customization/rules/index.md +++ b/en/building-sites/client-proofing/form-customization/rules/index.md @@ -1,17 +1,51 @@ --- title: "Form Customization Rules" +description: "The ten rules of a Form Customization set in MODX: what each of them does and in which grid of the set it is set." _old_id: "133" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules" --- -## What is a Rule? +## What the Rules Are -Rules in MODX Revolution are simply generic rules that apply to any Action (manager page). They also can be tied to User Groups, wherein a Rule will only be applied if the User is part of that User Group. +The rules are the changes a set applies to the form of the manager. There are ten of them, and each of them is set in one of the three grids of the set. -## What are the Rules available? +| Rule | What it does | Where it is set | +| --- | --- | --- | +| [Field Visible](building-sites/client-proofing/form-customization/rules/field-visible "Field Visible") | Hides a field of the form. | Fields, **Visible** | +| [Field Label](building-sites/client-proofing/form-customization/rules/field-label "Field Label") | Renames a field of the form. | Fields, **Label** | +| [Field Default](building-sites/client-proofing/form-customization/rules/field-default "Field Default") | Puts a value into a field of the form. | Fields, **Default Value** | +| [Tab Visible](building-sites/client-proofing/form-customization/rules/tab-visible "Tab Visible") | Hides a region of the form. | Regions, **Visible** | +| [Tab Title](building-sites/client-proofing/form-customization/rules/tab-title "Tab Title") | Renames a region of the form. | Regions, **Title** | +| [New Tab](building-sites/client-proofing/form-customization/rules/new-tab "New Tab") | Adds a region of its own to the form. | Regions, **Create** | +| [TV Visible](building-sites/client-proofing/form-customization/rules/tv-visible "TV Visible") | Hides a TV of the form. | Template Variables, **Visible** | +| [TV Title](building-sites/client-proofing/form-customization/rules/tv-title "TV Title") | Renames a TV of the form. | Template Variables, **Label** | +| [TV Default](building-sites/client-proofing/form-customization/rules/tv-default "TV Default") | Sets the default value of a TV. | Template Variables, **Default Value** | +| [Move TV to Tab](building-sites/client-proofing/form-customization/rules/move-tv-to-tab "Move TV to Tab") | Moves a TV into another region. | Template Variables, **Region** | -The available Rules are: +## The Rules Are Not Edited Directly -``` php -[[getResources@section? &parents=`133` &context=`revolution`]] -``` +There is no grid of rules in MODX 3. The rules are rebuilt from the three grids of the set every time the set is saved. What you change is the grid, not the rule. + +The three grids live on the tabs of the set: + +- **Set Information and Fields** — the set itself and the fields of the form; +- **Regions** — the regions of the form; +- **Template Variables** — the TVs of the template of the set. + +## The Order of the Rules + +The rules are applied in a fixed order, so that one rule never undoes another: + +1. the default value of a field; +2. the new region, then the visibility and the title of the regions; +3. the label and the visibility of the fields; +4. the default value, the label and the visibility of the TVs; +5. the move of a TV into another region. + +The move comes last on purpose: a TV can be moved into a region that the same set has just created. + +## See Also + +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md b/en/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md index 65d08c0d5..06616eb02 100644 --- a/en/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md +++ b/en/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md @@ -1,34 +1,25 @@ --- title: "Move TV to Tab" +description: "The Move TV to Tab rule of a Form Customization set in MODX: how it moves a template variable into another region." _old_id: "1353" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/move-tv-to-tab" --- -## The Move TV to Tab Rule +## What the Rule Does -The Move TV to Tab rule will move any TV to the tab you specify. +Moves a TV of the form of the manager into another region. The TV is drawn in that region instead of the one it belonged to. -## Usage +## Where It Is Set -Specify the ID of the tab to move to in the "name" field of the Rule. Then specify the TV's ID prefixed with 'tv' in the "value" field. +The **Template Variables** tab of the set, in the **Region** column. Put the id of the region you want the TV moved into. -The list of available tabs is: +**The id is not checked** +Whatever you type into the cell is taken as it is. A typo does nothing, and there is no message about it. Take the id from the list of the regions on [Customizing Tabs](building-sites/client-proofing/form-customization/tabs "Customizing Tabs"). The **Region (ID)** column of the **Regions** tab of the same set has them as well. -| ID | Description | -| ---------------------- | ------------------------------------------- | -| modx-resource-settings | The first tab, or Create/Edit resource tab. | -| modx-page-settings | The second tab, or Page Settings tab. | - -You can also create a tab with the [New Tab](building-sites/client-proofing/form-customization/rules/new-tab "New Tab") rule and move a TV there. - -## Examples - -An example rule for moving the TV 1 to the first tab in the Resource create page would look like so: - -![](rule-tvmove.png) +The **Region Rank** column next to it sets the order of the variables inside the region. ## See Also -``` php -[[getResources@section? &parents=`1353` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/new-tab.md b/en/building-sites/client-proofing/form-customization/rules/new-tab.md index ec75c775f..3c21b3ef4 100644 --- a/en/building-sites/client-proofing/form-customization/rules/new-tab.md +++ b/en/building-sites/client-proofing/form-customization/rules/new-tab.md @@ -1,44 +1,29 @@ --- title: "New Tab" +description: "The New Tab rule of a Form Customization set in MODX: how it adds a region of your own to the form." _old_id: "209" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/new-tab" --- - The following is relevant to older versions of MODX. See [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs#CustomizingTabsviaFormCustomization-AddingNewTabs) for instructions for newer versions of MODX. +## What the Rule Does -## The New Tab Rule +Adds a region of your own to the form of the manager. The region appears in the form as a tab of its own, next to the regions of the form of the resource. - The New Tab Rule, when set, will create a new tab in the panel. +## Where It Is Set -## Usage +The **Regions** tab of the set. Press **Create** to add a row to the grid, and fill in two fields: -- Specify the ID of this new tab in the "Name" field. -- Specify the tabpanel ID in the "Containing Panel" field -- Set the Rule to "New Tab" -- Set the title of the new tab in the "Value" field +- **Region (ID)** — the id of the region, for example `my-new-tab`. The id has to be unique within the set, and it is what you refer to when you move a TV into the region. +- **Title** — the text on the tab. -### Available TabPanels +The row can be deleted again with the **Delete** item of its context menu. Only a region that was created this way can be deleted; the regions of the form itself cannot. - Here are the IDs for the corresponding tab panels on various manager pages. +## Where the Region Appears -| ID | Corresponding Page | -| ------------------- | ------------------------------ | -| modx-resource-tabs | The Resource edit/create page. | -| modx-chunk-tabs | The Chunk page. | -| modx-snippet-tabs | The Snippet page. | -| modx-plugin-tabs | The Plugin page. | -| modx-template-tabs | The Template page. | -| modx-tv-tabs | The Template Variable page. | -| modx-user-tabs | The User page. | -| modx-usergroup-tabs | The User Group page. | -| modx-context-tabs | The Context page. | - - Tab Panels on non-Resource pages are only available in 2.0.0-pl and up. - -## Examples - - An example rule for creating a new tab in the Resource edit page would look like so: - - ![](rule-tabnew.png) +A region of your own is added to the form of the resource. It cannot be added to the form of another element. Form Customization does not cover the page of a chunk, a snippet, a user or a user group. ## See Also + +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/tab-title.md b/en/building-sites/client-proofing/form-customization/rules/tab-title.md index 32f7860a7..0549e32c2 100644 --- a/en/building-sites/client-proofing/form-customization/rules/tab-title.md +++ b/en/building-sites/client-proofing/form-customization/rules/tab-title.md @@ -1,32 +1,22 @@ --- title: "Tab Title" +description: "The Tab Title rule of a Form Customization set in MODX: how it renames a region of the form." _old_id: "300" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/tab-title" --- -## The Tab Title Rule +## What the Rule Does -The Tab Title Rule will change the title of any Tab. +Replaces the title of a region of the form with a text of your own. The region keeps its place in the form; only the text on its tab changes. -## Usage +## Where It Is Set -The values for the Rule should be as follows: +The **Regions** tab of the set, in the **Title** column. A region with a title of its own gets the rule; an empty cell keeps the standard title. -- **Name**: The ID of the tab to change. -- **Containing Panel**: The ID of the tabpanel to change. -- **Rule**: Tab Title -- **Value**: The new text to change the tab title to. - -For a list of tabs available for each page, see [Form Customization Pages](building-sites/client-proofing/form-customization "Form Customization Pages"). - -## Examples - -An example Rule of changing the title for the Page Settings tab for all [Users](building-sites/client-proofing/security/users "Users") to "Custom Fields" would look like this: - -![](fc-tabtitle.png) +The regions of the form always belong to the panel of the resource. A region of your own, created with the [New Tab](building-sites/client-proofing/form-customization/rules/new-tab "New Tab") rule, gets its title from the same column. ## See Also -``` php -[[getResources@section? &parents=`300` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/tab-visible.md b/en/building-sites/client-proofing/form-customization/rules/tab-visible.md index 5d22ca9d4..90056094d 100644 --- a/en/building-sites/client-proofing/form-customization/rules/tab-visible.md +++ b/en/building-sites/client-proofing/form-customization/rules/tab-visible.md @@ -1,21 +1,20 @@ --- title: "Tab Visible" +description: "The Tab Visible rule of a Form Customization set in MODX: how it hides a region of the form." _old_id: "301" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/tab-visible" --- -## The Tab Visible Rule +## What the Rule Does -The Tab Visible Rule, if set to 0, will hide a tab from a User. +Hides a region of the form of the manager. A region is a whole tab of the form or a part of one; the list of the regions is on [Customizing Tabs](building-sites/client-proofing/form-customization/tabs "Customizing Tabs"). -## Examples +## Where It Is Set -An example Rule of hiding the Page Settings tab for all [Users](building-sites/client-proofing/security/users "Users") would look like this: - -![](fc-tabvisible.png) +The **Regions** tab of the set, in the **Visible** column. Clearing the checkbox of a region creates the rule; ticking it back removes the rule. ## See Also -``` php -[[getResources@section? &parents=`301` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/tv-default.md b/en/building-sites/client-proofing/form-customization/rules/tv-default.md index e78b385c8..c157f7b17 100644 --- a/en/building-sites/client-proofing/form-customization/rules/tv-default.md +++ b/en/building-sites/client-proofing/form-customization/rules/tv-default.md @@ -1,32 +1,25 @@ --- title: "TV Default" +description: "The TV Default rule of a Form Customization set in MODX: how it sets the default value of a template variable." _old_id: "313" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/tv-default" --- -## The TV Default Value Rule +## What the Rule Does -The TV Default Value Rule, if set, will set the default value for a TV. +Sets the default value of a TV of the form of the manager. The value appears when the form opens. -This only works on "create" Actions, **not** "update" Actions. +The rule is applied on the page the set is bound to: the page that creates a resource, or the page that edits one. To have it only on the page that creates a resource, bind the set to the action **Create Resource** instead of **Create & Edit Resource**. -## Usage +## Where It Is Set -The values for the Rule should be as follows: +The **Template Variables** tab of the set, in the **Default Value** column. -- **Name**: The ID of the TV prefixed with 'tv'; for example, for the TV with ID 23, 'tv23' -- **Containing Panel**: 'modx-panel-resource' -- **Rule**: 'TV Default Value' -- **Value**: The value you want to set as the default. - -## Examples - -An example Rule of setting the default value for a TV with ID 23 to "test" is: - -![](fc-tvdefault.png) +**An empty cell zeroes the default value** +A cell that is cleared does not restore the default value of the variable: it sets an empty default. To get the original value back, type it into the cell yourself. ## See Also -``` php -[[getResources@section? &parents=`313` &context=`revolution`]] -``` \ No newline at end of file +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/tv-title.md b/en/building-sites/client-proofing/form-customization/rules/tv-title.md index aed30690b..7db03f11e 100644 --- a/en/building-sites/client-proofing/form-customization/rules/tv-title.md +++ b/en/building-sites/client-proofing/form-customization/rules/tv-title.md @@ -1,21 +1,20 @@ --- title: "TV Title" +description: "The TV Title rule of a Form Customization set in MODX: how it renames a template variable of the form." _old_id: "314" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/tv-title" --- -## The TV Title Rule +## What the Rule Does -The TV Title Rule will change the title of a TV. +Replaces the label of a TV of the form with a text of your own. The TV keeps its name and its value; only the text next to it changes. -## Examples +## Where It Is Set -An example Rule of setting the label to "Boo!" for a TV with ID of 1 for all [Users](building-sites/client-proofing/security/users "Users") would look like this: - -![](rule-tvlabel.png) +The **Template Variables** tab of the set, in the **Label** column. A TV with a label of its own gets the rule; an empty cell keeps the standard label. ## See Also -``` php -[[getResources@section? &parents=`314` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/rules/tv-visible.md b/en/building-sites/client-proofing/form-customization/rules/tv-visible.md index c0a9604ec..c81558dea 100644 --- a/en/building-sites/client-proofing/form-customization/rules/tv-visible.md +++ b/en/building-sites/client-proofing/form-customization/rules/tv-visible.md @@ -1,21 +1,20 @@ --- title: "TV Visible" +description: "The TV Visible rule of a Form Customization set in MODX: how it hides a template variable of the form." _old_id: "315" _old_uri: "2.x/administering-your-site/form-customization/form-customization-rules/tv-visible" --- -## The TV Visible Rule +## What the Rule Does -The TV Visible Rule, if set to 0, will hide a TV from a User. +Hides a TV of the form of the manager. The TV is not merely hidden: its type becomes `hidden`, so it is not drawn and cannot be filled in. -## Examples +## Where It Is Set -An example Rule of hiding the a TV with ID of 1 for all [Users](building-sites/client-proofing/security/users "Users") would look like this: - -![](rule-tvvisible.png) +The **Template Variables** tab of the set, in the **Visible** column. Clearing the checkbox of a TV creates the rule; ticking it back removes the rule. ## See Also -``` php -[[getResources@section? &parents=`315` &context=`revolution`]] -``` +1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) +2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) +3. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) diff --git a/en/building-sites/client-proofing/form-customization/sets.md b/en/building-sites/client-proofing/form-customization/sets.md index 9d781fb12..f534b358b 100644 --- a/en/building-sites/client-proofing/form-customization/sets.md +++ b/en/building-sites/client-proofing/form-customization/sets.md @@ -1,44 +1,57 @@ --- title: "Sets" +description: "A Form Customization set in MODX: the page it applies to, the template and the condition it is restricted by, and the three grids of rules it holds." _old_id: "134" _old_uri: "2.x/administering-your-site/customizing-the-manager/form-customization-sets" --- ## What is a Form Customization Set -A Form Customization Set is a collection of Rules that occur for a specific page (action) in the Manager. Currently, Sets can apply to either the Resource Create or Update pages. Think of them like a way of collecting all your "Whenever the Create Resource page loads, all these fields change." rules. Sets can also be marked 'inactive' to not load. +A Form Customization Set is a collection of Rules that apply to a specific page (action) in the manager. Think of a set as a way of collecting all your "Whenever the Edit Resource page loads, all these fields change" rules. A set can also be marked 'inactive' so that it does not load. + +A set is bound to one of three actions: **Create Resource**, **Edit Resource** or **Create & Edit Resource**. See [Customizing the Manager](building-sites/client-proofing/form-customization "Customizing the Manager"). ### Restricting to a Template -You can select a Template that the Set is restricted to load to. If a Resource (or on Create Resource, the parent's template or "default\_template" setting) has this as its Template, this Set will run. Not setting a Template will assume that the Set should run for all Resources. +You can select a Template that the Set is restricted to. If a Resource has this Template, the Set runs. On Create Resource, the Template of the parent or the `default_template` setting is used. A Set without a Template runs for all Resources. -Also, setting a Template restricts the list of Template Variables that are shown to be editable to the Template Variables assigned to that Template. +Setting a Template also restricts the list of Template Variables that are shown to be editable to the Template Variables assigned to that Template. ### Using Constraints -A Constraint can be set on the Set to restrict to a certain value. For example, setting a Constraint to a field of 'parent' and value of '123' will apply this Set to all direct children of parent 123. A Constraint for field 'class\_key' and value 'modWebLink' will apply this Set to all WebLinks for the Set's page. +A Constraint restricts a Set to a certain value. For example, a Constraint of field `parent` and value `123` applies the Set to all direct children of the resource 123. A Constraint of field `class_key` and value `MODX\Revolution\modWebLink` applies the Set to all WebLinks on the page of the Set. + +Both parts of the constraint have to be filled in. Fill in only one of them and the set does not save. + +The value may be a comma-separated list. The rule then applies to any of the values in the list. + +The value is compared with the field of the resource as it is. The field `class_key` holds the full name of the class, with its namespace. ## Making Set Rules -Rules can be adjusted in a set by using the grids and tabs in the Set editing page. When you're done editing the fields, use the "Save" button on the top right to save the set. +Rules are adjusted in a set by using the grids on the Set editing page. The page has three tabs: **Set Information and Fields**, **Regions** and **Template Variables**. When you're done, use the "Save" button on the top right to save the set. + +Changing the template of a set reloads the page and rebuilds the list of the TVs for the new template. ### Adjusting Fields -Fields are found on the first tab in the Set editing page. You can change the visibility of a field, the Label given to the field, or its default value. (Note: default value changes only apply to 'Create' pages.) To revert back to the normal label or default value for a field, simply leave the field blank. +Fields are found on the **Set Information and Fields** tab of the Set editing page. You can change the visibility of a field, the Label given to the field, or its default value. To revert back to the normal label of a field, simply leave the field blank. -### Hiding or Renaming Tabs +The fields you can change are the fields of the form of the resource: `id`, `pagetitle`, `alias`, `longtitle`, `description`, `introtext`, `content`, `published`, `deleted`, `publishedon`, `pub_date`, `unpub_date`, `template`, `hidemenu`, `menutitle`, `link_attributes`, `menuindex`, `class_key`, `content_type`, `parent`, `content_dispo`, `isfolder`, `show_in_tree`, `hide_children_in_tree`, `alias_visible`, `uri_override`, `uri`, `richtext`, `cacheable`, `searchable`, `syncsite`. -Tabs are found in the 2nd tab in the Set editing page. You can change their visibility, as well as their title. You can also create new tabs to show up on the editing page. +### Hiding or Renaming Regions -When creating a new tab, you'll be presented with both ID and Title fields. The Title field is what will show as the text of the new tab; whereas the ID is what is used when moving TVs into the tab. +Regions are found on the **Regions** tab of the Set editing page. You can change their visibility, as well as their title. You can also create a new region to show up on the editing page. -See [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs "Customizing Tabs via Form Customization") for more information. +See [Customizing Tabs](building-sites/client-proofing/form-customization/tabs "Customizing Tabs") for more information. ### Adjusting Template Variables -TVs are found in the 3rd tab in the Set editing page. You can adjust their Label, default value, visibility, or what tab they reside on. +TVs are found on the **Template Variables** tab of the Set editing page. You can adjust their Label, default value, visibility, or what region they reside on. -If you want to change what Tab a TV resides on, simply change the tab field to the ID of the tab you want to move it to. The 'Tab Rank' column allows you to adjust the order in which the TV is put into the Tab with regard to other TVs being moved into that Tab. +To change what region a TV resides on, change the Region field to the id of the region you want to move it to. The 'Region Rank' column sets the order of the TV among the other TVs moved into that region. + +The rules are applied in a fixed order, and the move of a TV comes last. A TV can be moved into a region that the same set has just created. See [Form Customization Rules](building-sites/client-proofing/form-customization/rules "Form Customization Rules"). ## Editing Sets via XML @@ -46,9 +59,21 @@ Sets can be exported to XML files by right-clicking on a Set in the Profile's ed Importing a Set from XML will create a **new** Set, not override any existing ones. After you've imported the Set from XML, you may deactivate any older Sets. +**The rules of the TVs do not survive the import** +The importer writes the rules of a TV under the bare id of the variable. Everything that reads them looks for the id with the prefix `tv`. The rules of the TVs of an imported set have to be set again by hand in the grids of the set. + +## The API of the Section + +A package can work with the section through the actions of the connector. All of them need the permission `customize_forms`: + +- `Security/Forms/Profile/Activate`, `ActivateMultiple`, `Create`, `Deactivate`, `DeactivateMultiple`, `Duplicate`, `GetList`, `Remove`, `RemoveMultiple`, `Update`, `UpdateFromGrid`; +- `Security/Forms/Set/Activate`, `ActivateMultiple`, `Create`, `Deactivate`, `DeactivateMultiple`, `Duplicate`, `Export`, `GetList`, `Import`, `Remove`, `RemoveMultiple`, `Update`, `UpdateFromGrid`. + ## See Also -1. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) -2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) - 1. [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs) -3. [Manager Templates and Themes](building-sites/client-proofing/custom-manager-themes) +1. [Customizing the Manager](building-sites/client-proofing/form-customization) +2. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) +3. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) + 1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) + 2. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) +4. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) diff --git a/en/building-sites/client-proofing/form-customization/tabs.md b/en/building-sites/client-proofing/form-customization/tabs.md index fb9f7535b..bdc1ed4e1 100644 --- a/en/building-sites/client-proofing/form-customization/tabs.md +++ b/en/building-sites/client-proofing/form-customization/tabs.md @@ -1,42 +1,56 @@ --- title: "Customizing Tabs" +description: "The regions of the form of a resource in MODX that Form Customization can hide or rename, and how to add a region of your own." _old_id: "82" _old_uri: "2.x/administering-your-site/customizing-the-manager/form-customization-sets/customizing-tabs-via-form-customization" --- - When you use Form Customization to customize the forms in the MODX manager, you can either allow/disallow access to specific fields, or you can allow/disallow access to entire tabs or _parts_ of tabs. +Form Customization hides or renames whole tabs of the form of a resource, and parts of those tabs. - **When a Tab is not a Tab** - When setting up Form Customization rules under **Security --> Form Customization**, then editing a behavior set, there is a list of "Tabs", but the list doesn't correspond directly to the familiar "Document", "Settings", "Template Variables", and "Resource Groups". Rather, the tab ids listed here refer to entire tabs or _parts_ of tabs. +**When a Tab is not a Tab** +Setting up Form Customization under **Admin → Form Customization** and editing a set shows a list of "Regions". The list doesn't correspond directly to the familiar "Document", "Settings", "Template Variables", and "Resource Groups". The region ids listed here refer to entire tabs or _parts_ of tabs. ## Tab Regions - These are the various tab regions whose visibility can be toggled. - -| ID | Default Tab Title | Description | -| ---------------------------------- | ------------------ | ------------- | -| modx-resource-settings | Document | A primary tab | -| modx-resource-main-left | | | -| modx-resource-main-right | | | -| modx-page-settings | Settings | A primary tab | -| modx-page-settings-left | | | -| modx-page-settings-right | | | -| modx-page-settings-right-box-left | | | -| modx-page-settings-right-box-right | | | -| modx-panel-resource-tv | Template Variables | A primary tab | -| modx-resource-access-permissions | Resource Groups | A primary tab | +These are the various tab regions whose visibility can be toggled. + +| ID | Default Tab Title | Description | +| --- | --- | --- | +| modx-resource-settings | Document | A primary tab | +| modx-resource-main-left | | | +| modx-resource-content-above | | | +| modx-resource-content-below | | | +| modx-resource-main-right | | | +| modx-resource-main-right-top | | | +| modx-resource-main-right-middle | | | +| modx-resource-main-right-bottom | | | +| modx-page-settings | Settings | A primary tab | +| modx-page-settings-left | | | +| modx-page-settings-right | | | +| modx-page-settings-box-left | | | +| modx-page-settings-box-right | | | +| modx-panel-resource-tv | Template Variables | A primary tab | +| modx-resource-access-permissions | Resource Groups | A primary tab | + +A set that is bound to the action **Create Resource** offers two regions less: `modx-resource-content-above` and `modx-resource-content-below`. + +The list of the regions is stored in a reference table, and it is filled in when MODX is installed. A database that was upgraded from 2.x may have a shorter list. ## Adding New Tabs - Adding a new tab is quite simple. Edit your Set, and open the Regions tab. Click the Create New Tab button, give it an ID like "my-new-tab" and a description. +Adding a new tab is quite simple. Edit your Set, and open the **Regions** tab. Press **Create**, give the region an ID like `my-new-tab` and a **Title**. ![](fc_new_tab.jpg) -Any time you need to refer to the tab region, for example if moving Template Variables into the new tab, use the ID you gave it. +Any time you need to refer to the region, for example when moving Template Variables into the new tab, use the ID you gave it. + +The id has to be unique within the set. A region created this way can be deleted again with the **Delete** item of its context menu. The regions of the form itself cannot. ## See Also -1. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) -2. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) - 1. [Customizing Tabs via Form Customization](building-sites/client-proofing/form-customization/tabs) -3. [Manager Templates and Themes](building-sites/client-proofing/custom-manager-themes) +1. [Customizing the Manager](building-sites/client-proofing/form-customization) +2. [Form Customization Profiles](building-sites/client-proofing/form-customization/profiles) +3. [Form Customization Sets](building-sites/client-proofing/form-customization/sets) + 1. [Form Customization Rules](building-sites/client-proofing/form-customization/rules) + 2. [Customizing Tabs](building-sites/client-proofing/form-customization/tabs) +4. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) diff --git a/en/building-sites/client-proofing/index.md b/en/building-sites/client-proofing/index.md index d3746cbc1..20066a543 100644 --- a/en/building-sites/client-proofing/index.md +++ b/en/building-sites/client-proofing/index.md @@ -1,7 +1,33 @@ --- title: "Client-proofing the manager" +description: "Tone down the Manager of MODX for a client: the look of the manager and of the login page, the dashboards, the forms of the manager, and the access to it." --- The manager is a very powerful administrative interface, and when you've built a site for a client it is likely you'll want to tone a few things down a bit. -There are different tools at your disposal for that. +## The Look of the Manager + +- [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) — override the files of the manager with a theme of your own. +- [Customizing the Login](building-sites/client-proofing/manager-login) — the logo, the background, the help block and the language of the login page. +- The setting `manager_logo` puts your own logo into the left panel of the manager. + +## The Dashboards + +[Dashboards](building-sites/client-proofing/dashboards) — the widgets on the page a user sees after logging in, and who sees which. + +## The Forms of the Manager + +[Form Customization](building-sites/client-proofing/form-customization) — the profiles that hide fields, rename tabs and change values, and the sets of rules they hold. + +## The Access to the Manager + +[Security](building-sites/client-proofing/security) — the policies, the permissions, the user groups, the roles and the resource groups that decide what a user may do. + +## See Also + +1. [Client-proofing the manager](building-sites/client-proofing) +2. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) +3. [Customizing the Login](building-sites/client-proofing/manager-login) +4. [Dashboards](building-sites/client-proofing/dashboards) +5. [Form Customization](building-sites/client-proofing/form-customization) +6. [Security (ACLs)](building-sites/client-proofing/security) diff --git a/en/building-sites/client-proofing/manager-login.md b/en/building-sites/client-proofing/manager-login.md index 626545ea5..26a487bcd 100644 --- a/en/building-sites/client-proofing/manager-login.md +++ b/en/building-sites/client-proofing/manager-login.md @@ -1,41 +1,83 @@ --- title: Customizing the Login +description: "The login page of the MODX Manager: its logo, the background image, the help block, the language, and the settings that change them." --- -With MODX3 you get more and easier control over the appearance of the manager login page. +The login page of MODX 3 has its own settings, its own template, and its own events. You can change its look without changing the rest of the manager. ## Logo -By default, the MODX logo will be used. This file is included in the release in `/manager/templates/default/images/modx-logo-color.svg`. +The site logo is used by default. The file is `manager/templates/default/images/modx-logo-color.svg`. -To use a different logo, provide an image URL in the the `login_logo` system setting. This can be both a local file or an external (full) URL. The image is limited to a width of 192 pixels (or 384 on 2x displays). +To use a different logo, put the address of an image into the `login_logo` system setting. It can be a local file or a full external URL. The image is limited to a width of 192 CSS pixels. -## Background image +The logo is also used in the manager's letters, in the standard template `email/default.tpl`. -The background image on the login screen is a default one included in `/manager/templates/default/images/login/default-background.jpg`. The photo provided with MODX 3.0.0 was created by Christian Seel, and shows a mountain range near Engelberg, Switzerland, where the new login experience was originally built during a SnowUp event. ([Source](https://github.com/modxcms/revolution/pull/13773#issuecomment-364594061)) +**A custom theme needs its own logo** +The default logo is read from the directory of the theme, with no fallback to `default`. A theme that has no `images/modx-logo-color.svg` shows a broken logo on the login page. -> If you've created or use a custom manager theme, you must also provide a `/manager/templates/YOUR-THEME/images/login/default-background.jpg` file to act as the default. +The favicon of the page is a separate setting, `manager_favicon_url`. + +## Background Image -To change the background to a different image, provide an image URL in the `login_background_image` system setting. This can be both a local file or an external (full) URL. A landscape image works best. +The login background ships as `manager/templates/default/images/login/default-background.jpg`. The photo in MODX 3.0.0 is by Christian Seel ([source](https://github.com/modxcms/revolution/pull/13773#issuecomment-364594061)). -### Changing programmatically +To use another image, put its address in the `login_background_image` system setting. It can be a local file or a full external URL. A landscape image works best. + +> [!NOTE] +> If you've created or use a custom manager theme, you must also provide a `/manager/templates/YOUR-THEME/images/login/default-background.jpg` file to act as the default. -Alternatively, the background can also be changed programmatically with a plugin. +### Changing Programmatically -One pre-made example of that is the [DailyPhoto extra](https://modx.com/extras/package/dailyphoto) which uses a different random photo each day from Unsplash. +A plugin can set the background, which is how you give every visitor a different picture. One ready-made example is the [DailyPhoto extra](https://modx.com/extras/package/dailyphoto), which uses a different random photo each day from Unsplash. -To create your own custom logic for the background image, create a plugin that listens to the `OnManagerLoginFormRender` system event, with code like this: +To set the background yourself, create a plugin that listens to the `OnManagerLoginFormRender` system event: -```php +``` php $modx->controller->setPlaceholder('background', '/full/url/to/image.jpg'); ``` -## Help block +The event `OnManagerLoginFormPrerender` places its output before the form. A plugin on that event cannot set the background: the theme writes the placeholder after Prerender runs. + +## Help Block + +The login page includes a help block, disabled by default. Set the `login_help_button` system setting to yes, and a help link shows at the bottom of the login panel. + +The content of the login block is managed in the lexicon. Go to **Admin → Lexicons**, select `core` as the namespace (if it is not pre-selected) and the `login` topic, and choose the language to edit. The relevant lexicon keys are `login_help_button_text`, `login_help_text`, and `login_help_title`. Double-click a value to edit it. + +The text of the greeting is chosen by the time of day from the keys `login_greeting_morning`, `login_greeting_afternoon`, `login_greeting_evening` and `login_greeting_night` of the same topic. + +## Language + +The language of the login page is picked on the page itself. It is not the `manager_language` setting. In MODX 3 that setting is removed on upgrade, and the language lives in the session. + +The page uses the first source that has a language: + +| Order | Source | +| --- | --- | +| 1 | The request | +| 2 | The session | +| 3 | The browser | +| 4 | `en` | + +## Other Settings + +| Setting | What it changes | +| --- | --- | +| `allow_manager_login_forgot_password` | Whether the block for resetting a forgotten password is shown. | +| `manager_login_url_alternate` | The address an unauthorized user is sent to, instead of the login page. | +| `manager_direction` | The direction of the text, `rtl` for a right-to-left language. | +| `compress_css` | Whether the login page links the minified stylesheet. | +| `password_min_length` | The minimum length of a password, in the hint under the field. | +| `session_cookie_lifetime` | The lifetime of the session, shown in the label of the "remember me" checkbox. | -The login page also includes a help block, however this is disabled by default. To enable it, set the `login_help_button` system setting to yes. A help link will then be shown at the bottom of the login panel. +## Passwordless Login -The content of the login block is managed in the lexicon. To change, go to System > Lexicons. Select `core` as the namespace (if not pre-selected by default) and the `login` topic. Also choose the language to edit. The relevant lexicon keys are `login_help_button_text`, `login_help_text`, and `login_help_title` which can be edited by double clicking on the value. +Instead of a username and a password, the login page can offer [logging in with a magic link](building-sites/client-proofing/security/passwordless-login). With `passwordless_activated` set, the form shows only the field for the e-mail address. The lifetime of the link is set by the `passwordless_expiration` setting, 3600 seconds by default. -## Passwordless login +## See Also -If desirable you can also enable [logging in with a magic login link](building-sites/client-proofing/security/passwordless-login) instead of a username and password. +1. [Client-proofing the manager](building-sites/client-proofing) +2. [Custom Manager Themes](building-sites/client-proofing/custom-manager-themes) +3. [Customizing the Login](building-sites/client-proofing/manager-login) +4. [Logging in with a magic link](building-sites/client-proofing/security/passwordless-login) diff --git a/en/building-sites/client-proofing/security/index.md b/en/building-sites/client-proofing/security/index.md index 0fda5c1c5..896df9403 100644 --- a/en/building-sites/client-proofing/security/index.md +++ b/en/building-sites/client-proofing/security/index.md @@ -1,25 +1,45 @@ --- title: "Security (ACLs)" +description: "The security model of MODX: the groups, the policies and the permissions, and how an access control list ties them together." _old_id: "488" _old_uri: "2.x/administering-your-site/security" --- -## Security in MODX Revolution +## The Security Model -Security in MODX Revolution is primarily driven by an Attribute-Based Access Control (ABAC) paradigm. +Security in MODX is list-based. The rights are granted to User Groups and are tied to an object with a minimum role. -Each user in MODX has a [User](building-sites/client-proofing/security/users "Users") object, which can be assigned to any number of [User Groups](building-sites/client-proofing/security/user-groups "User Groups"). Each User Group then has attributes assigned to it via [Access Control Lists](building-sites/client-proofing/security/policies/acls "ACLs") (ACLs). These ACLs take a variety of names depending on how they are applied, but all share one common principle - they contain a list of [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions"). These Permissions allow access to different areas or actions within MODX. +Every user can be a member of any number of User Groups. Each User Group gets its attributes from Access Control Lists (ACLs), which contain a list of Permissions. The permissions open up the different areas and actions of MODX. -ACLs usually have the following: +An ACL usually has the following: -- **Principal** - The object that is getting the access permissions. This is in MODX, by default, a User Group. -- **Target** - The object they apply to, for example, a Context or Resource Group. +- **Principal** - The object that is getting the access permissions. In MODX, by default, a User Group. +- **Target** - The object they apply to, for example a Context or Resource Group. - **Access Policy** - The list of Permissions that is gained by this ACL. - **Authority** - The minimum Authority level required to use this ACL (see [Roles](building-sites/client-proofing/security/roles "Roles")). -Access is **allow/deny** in MODX, meaning that access is "open" by default. Once an ACL is applied to an object, such as a Context or Resource Group, those Contexts or Resource Groups will now only be accessible to the objects with appropriate Permissions. +A user passes the check of an ACL when the authority of their role in the group is **not greater** than the authority of that ACL. The policies are given to the group; the role is only the number that is compared with it. -### Security Tutorial Video +Access is **allow/deny** in MODX, meaning that access is "open" by default. Once an ACL is applied to an object, such as a Context or Resource Group, only the objects with appropriate Permissions can reach it. + +### The Permissions of the Page + +The page of the Access Control Lists needs the permission `access_permissions`. + +## What a Fresh Installation Looks Like + +MODX 3 creates the following when it is installed: + +| Who | What | +| --- | --- | +| The anonymous user | The policy **Load Only** on the context `web`, with the authority 9999. | +| The group `Administrator` | The policy **Administrator** on the contexts `web` and `mgr`, with the authority 0 — the role Super User. | + +The anonymous user is not a group: it is an ACL with the principal `0`. There is no group "Anonymous" in the database, and the tree of the groups shows a pseudo entry "(Anonymous)". + +The role **Member** has the authority 9999, so it does not pass the check of an ACL with the authority 0. A user with the role **Super User** does. + +## Security Tutorial Video Demonstrates by applying concepts to the MODX Sample Site to: @@ -32,8 +52,55 @@ Demonstrates by applying concepts to the MODX Sample Site to: ### Example: Context Access -A good example is creating a Context named 'test', and assigning an ACL to it. This can be done by editing the Context, and going to the 'Access Permissions' tab. From here, you can give a User Group (say, 'HR Dept') explicit access to this Context by selecting the User Group, the 'Administrator' Access Policy, and specifying a required Authority (say, 9999 for 'Member') to have: +A good example is creating a Context named 'test', and assigning an ACL to it. This can be done by editing the Context, and going to the 'Access Permissions' tab. From here, you can give a User Group (say, 'HR Dept') explicit access to this Context. Select the User Group, the 'Administrator' Access Policy, and a required Authority (say, 9999 for 'Member'): ![](sec-ugctx1.png) This will restrict the 'test' Context to users who are a Member (or [Role](building-sites/client-proofing/security/roles "Roles") with more authority) of the 'HR Dept' User Group. + +## Events + +The behaviour of the authentication and of the accounts can be changed with a plugin. The events of the section: + +| Event | When it fires | +| --- | --- | +| OnManagerLogin, OnWebLogin | After a user has logged in. | +| OnManagerAuthentication, OnWebAuthentication | While a user is being authenticated. | +| OnUserNotFound | When a login names a user that does not exist. | +| OnManagerLogout, OnWebLogout | After a user has logged out. | +| OnBeforeManagerLogout, OnBeforeWebLogout | Before a user logs out. | +| OnUserBeforeSave, OnUserSave | Before and after a user is saved. | +| OnUserBeforeRemove, OnUserRemove | Before and after a user is removed. | +| OnUserFormSave, OnBeforeUserFormSave | Before and after a user is saved from the form of the manager. | +| OnUserChangePassword | After a user has changed the password. | +| OnUserActivate, OnBeforeUserActivate | After and before a user is activated. | +| OnUserDeactivate, OnBeforeUserDeactivate | After and before a user is deactivated. | +| OnUserBeforeAddToGroup, OnUserAddToGroup | Before and after a user is added to a group. | +| OnUserBeforeRemoveFromGroup, OnUserRemoveFromGroup | Before and after a user is removed from a group. | +| OnUserGroupBeforeSave, OnUserGroupSave | Before and after a group is saved. | +| OnUserGroupBeforeRemove, OnUserGroupRemove | Before and after a group is removed. | +| OnResourceGroupBeforeSave, OnResourceGroupSave | Before and after a resource group is saved. | +| OnBeforeResourceGroupRemove, OnResourceGroupRemove | Before and after a resource group is removed. | +| OnResourceAddToResourceGroup, OnResourceRemoveFromResourceGroup | When a resource is added to or removed from a resource group. | + +## See Also + +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/passwordless-login/index.md b/en/building-sites/client-proofing/security/passwordless-login/index.md index a3c969c29..13a510c2a 100644 --- a/en/building-sites/client-proofing/security/passwordless-login/index.md +++ b/en/building-sites/client-proofing/security/passwordless-login/index.md @@ -1,31 +1,59 @@ --- title: "Passwordless login" sortorder: 0 +description: "Logging in to MODX with a magic link instead of a password: how to turn it on, how long the link lives, and what it does not change." --- -MODX3 has a new feature named "passwordless login", which can be activated by a system setting. Once you have activated that feature, it is no longer needed to enter a password and a username to login. Instead, you simply enter your account's email address, and the system will send you an email with a one-time login link. By clicking on that link you will then be immediately being logged into the manager. +MODX 3 can log a user in without a password. With the feature activated, the login form asks for an e-mail address only, and sends a one-time login link to it. Clicking the link logs the user into the manager. ## Benefits of passwordless login -Having the need for a strong password often makes people choose generic pseudo-strong passwords by reusing a proven strong phrase and maybe just adding a number per service. As a site administrator you should not encourage your users to do insecure things. This moves the risk of having an insecure password away from your MODX installation, but of course needs a secure email account for your users. But this is also the case for the traditional username+password login, because this also has the password self-service where you can reset your password via email. +As a site administrator you should not encourage your users to choose insecure passwords. Passwordless login moves the risk of a weak password away from your MODX installation, but of course needs a secure e-mail account for your users. The traditional username and password login has the same requirement, because it also offers self-service password resets by e-mail. The gain is that the user has no password to choose, to remember or to reuse. -Additionally, if passwordless login is enabled, no passwords are stored any more in the MODX database. Then there is no more theoretical risk of passwords being stolen by a database breach (regardless of any encryption). +## The Password Is Replaced + +Logging in by a link replaces the password of the user. The handler writes a generated password into the field `password`, where only its hash is stored, and logs the user in with it. The password the user chose is therefore gone after the first link — the account is left with a password that nobody knows. ## How to enable passwordless login -In order to activate the passwordless login, you need to set the system setting `passwordless_activated` in the area "Authentication and Security" of the core system settings to "Yes". The next time you login you will be presented the following login screen: +Set the system setting `passwordless_activated` in the area "Authentication and Security" of the core system settings to "Yes". The setting is off by default. The next time you log in you will be presented the following login screen: ![](passwordless-login-screen.jpg) - -Just enter your account's email address and you will receive an email with a - personal login link. + +Just enter the account's e-mail address and you will receive an e-mail with a personal login link. ![](passwordless-email.png) - + ## Configure link expiration -You can configure the expiration time of the login link via the system setting `passwordless_expiration`. By default it is set to 3600 seconds, which should be way enough for everyone to login. If you are paranoid, you can easily set it to a lower value, e.g. 600 to allow usage of the link only for 10 minutes. The validity period will also be shown in the email itself. +You can configure the expiration time of the login link via the system setting `passwordless_expiration`. By default it is set to 3600 seconds, which is enough for everyone to log in. Set it to a lower value, e.g. 600, to allow usage of the link only for 10 minutes. The validity period will also be shown in the e-mail itself. + +## The Link Is Used Once + +The link works only once: the record is removed from the registry as soon as it has been used. The token of the link is signed with the hash of the user's password, so a link stops working as soon as the password changes. ## Additional notes -Be aware that there will be _no error message_ if you enter an unknown email address during login. This is a well-known and intended behavior to prevent user-enumeration attempts. +Be aware that there will be _no error message_ if you enter an unknown e-mail address during login. This is a well-known and intended behavior to prevent user-enumeration attempts. + +## See Also + +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/policies/acls.md b/en/building-sites/client-proofing/security/policies/acls.md index 2c0a39e5e..5f0dcef90 100644 --- a/en/building-sites/client-proofing/security/policies/acls.md +++ b/en/building-sites/client-proofing/security/policies/acls.md @@ -1,5 +1,6 @@ --- title: "ACLs" +description: "The access control lists of MODX: the five kinds of ACL, what a group gets with one, and how the role is compared with it." _old_id: "9" _old_uri: "2.x/administering-your-site/security/policies/acls" --- @@ -10,18 +11,28 @@ An ACL, or Access Control List, is a set of [Permissions](building-sites/client- ## Usage -In MODX, ACLs can be applied to any modAccessibleObject. Primarily MODX Revolution 2.0 allows for ACLs on Resources and Contexts. +MODX 3 has five kinds of ACL. Each of them is set on a tab of a User Group: + +| Kind | What it restricts | +| --- | --- | +| Context ACL | The access to a context. | +| Resource Group ACL | The access to the resources of a resource group. | +| Element Category ACL | The access to the elements of a category, and to the fields of a resource. | +| Media Source ACL | The access to the files of a media source. | +| Namespace ACL | The access to the elements of a namespace. | + +The first two are described below. ### Context ACL -A Context ACL is referenced of 4 parts: +A Context ACL is made of 4 parts: - A [Context](building-sites/contexts "Contexts") - A [User Group](building-sites/client-proofing/security/user-groups "User Groups") - A [Minimum Role](building-sites/client-proofing/security/roles "Roles") - An [Access Policy](building-sites/client-proofing/security/policies "Policies") -This means that one can assign a ACL to a Context that will apply to: +This means that one can assign an ACL to a Context that will apply to: - All the Users in a User Group - ...with at least the Minimum Role specified @@ -53,30 +64,30 @@ That has a few practical consequences: 1. A policy that grants `publish_document` only on a frontend context (`web` or another site context) does **not** unlock manager publish controls. You need a Context Access ACL on **`mgr`**. 2. Resource ACL permissions `publish` / `unpublish` (on the [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy)) are a different ACL surface. The current manager publish UI and save path do not use them. 3. Multiple user groups still **OR** together for a given context. `checkPolicy` returns true when **any** matching Context Access ACL for that context grants the permission. You do not need every group to include publish. -4. A common trap: one shared group gives **Content Editor** (no publish) on `mgr`, and a second group puts a custom policy with publish only on another context. The user is in both groups, but still cannot publish in the manager until `publish_document` exists on an **`mgr`** Context Access ACL. +4. A common trap: one shared group gives **Content Editor** (no publish) on `mgr`, and a second group puts a custom policy with publish on another context. The user is in both groups, but still cannot publish in the manager until `publish_document` exists on an **`mgr`** Context Access ACL. -To fix that setup: add Context Access for **`mgr`** on at least one of the user's groups, with a policy that includes `publish_document` (and `unpublish_document` if needed). Leave Content Editor on the other group if you want. Flush sessions/permissions and retest. +To fix that setup, add Context Access for **`mgr`** on at least one of the user's groups. Use a policy that includes `publish_document` (and `unpublish_document` if needed). Leave Content Editor on the other group if you want. Flush sessions/permissions and retest. See also [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) (`publish_document`) and [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access). Background: [modxcms/revolution#14925](https://github.com/modxcms/revolution/issues/14925). ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/policies/index.md b/en/building-sites/client-proofing/security/policies/index.md index be120cae3..01d79439e 100644 --- a/en/building-sites/client-proofing/security/policies/index.md +++ b/en/building-sites/client-proofing/security/policies/index.md @@ -1,31 +1,43 @@ --- title: "Policies" +description: "The access policies of MODX: the twelve that ship with the core, and the template that decides what a policy may hold." _old_id: "243" _old_uri: "2.x/administering-your-site/security/policies" --- ## What is an Access Policy? -An Access Policy is a set of [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") containing one or many Permissions, as defined in the manager. By default MODX comes with pre-configured Access Policies: +An Access Policy is a list of [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions"), defined in the manager. By default MODX comes with twelve pre-configured Access Policies: -- **Administrator**: Context administration policy with all default permissions. -- **Content Editor**: Context administration policy with limited, content-editing related Permissions, but no publishing Permissions (`publish_document` / `unpublish_document`). -- **Context**: A standard Context policy that you can apply when creating Context ACLs for basic read/write and view\_unpublished access within a Context. -- **Element**: MODX Element policy with all attributes. -- **Load Only**: A minimal policy with permission to load an object. -- **Load, List and View**: Provides load, list and view permissions only. -- **Media Source Admin**: Media Source administration policy. -- **Media Source User**: Media Source user policy, with basic viewing and using - but no editing - of Media Sources. -- **Object**: An Object policy with all permissions. -- **Resource**: MODX Resource Policy with all attributes. +| Policy | What it is | Policy Template | +| --- | --- | --- | +| Administrator | Context administration policy with all default permissions. | AdministratorTemplate | +| Content Editor | Context administration policy with limited, content-editing related Permissions, but no publishing Permissions (`publish_document` / `unpublish_document`). | AdministratorTemplate | +| Context | A standard Context policy that you can apply when creating Context ACLs for basic read/write and view\_unpublished access within a Context. | ContextTemplate | +| Developer | Context administration policy with all permissions of the administrator, except the administrative and the security ones. | AdministratorTemplate | +| Element | MODX Element policy with all attributes. | ElementTemplate | +| Hidden Namespace | Hides a namespace from the lists. It grants `load` and `view`, and denies `list`. | NamespaceTemplate | +| Load Only | A minimal policy with permission to load an object. | ObjectTemplate | +| Load, List and View | Provides load, list and view permissions only. | ObjectTemplate | +| Media Source Admin | Media Source administration policy. | MediaSourceTemplate | +| Media Source User | Media Source user policy, with basic viewing and using - but no editing - of Media Sources. | MediaSourceTemplate | +| Object | An Object policy with all permissions. | ObjectTemplate | +| Resource | MODX Resource Policy with all attributes. | ResourceTemplate | -If you customize any of the above default Access Policies, duplicate (and rename) them before customizing! If you don't do that all customizations will be lost when updating MODX to a newer version as they get overridden by the setup script. +The Policy Template of a policy decides which permissions it can hold at all. It is the list of checkboxes you get when you create the policy. See [Policy Templates](building-sites/client-proofing/security/policies/policytemplates "Policy Templates"). + +**Duplicate a default policy before you change it** +The setup script recreates the policies of the core on every update, so your changes to them can be lost. + +## The Permissions of the Page + +The page of the policies needs the permission `policy_view` to see the list, `policy_new` and `policy_save` to create a policy, `policy_edit` to change one, and `policy_delete` to delete one. The templates need `policy_template_view`, `policy_template_new`, `policy_template_save`, `policy_template_edit` and `policy_template_delete`. ## Creating and Editing To create an Access Policy in the manager, navigate to -> Security -> Access Controls -> Access Policies +> the lock icon in the user menu → **Access Control Lists** → the tab **Policies** From there you can add new policies. To edit an Access Policy in the manager, simply right-click the Policy you want to edit. @@ -35,7 +47,7 @@ Policies can be used in a myriad of different ways. Here are 3 example usages th ### Context Access -Access Policies can be assigned as [Access Control Lists](building-sites/client-proofing/security/policies/acls "ACLs") (ACLs) to a Context and User Group, with a specified Minimum [Role](building-sites/client-proofing/security/roles "Roles"). When done, this means that all the Users in that User Group with at least the Role specified as the Minimum Role can use the Permissions in the Policy in the Context specified in the [ACL](building-sites/client-proofing/security/policies/acls "ACLs"). +Access Policies can be assigned as [Access Control Lists](building-sites/client-proofing/security/policies/acls "ACLs") (ACLs) to a Context and User Group, with a specified Minimum [Role](building-sites/client-proofing/security/roles "Roles"). When done, all the Users in that User Group with at least the Minimum Role can use the Permissions in the Policy. This applies to the Context specified in the [ACL](building-sites/client-proofing/security/policies/acls "ACLs"). MODX comes with a default ["Administrator" Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy "Permissions - Administrator Policy") that contains all the [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") one would use in a Context ACL. It's best to duplicate this policy when creating a custom access policy for restricting manager users. @@ -43,7 +55,7 @@ Manager publish controls require `publish_document` on a Context Access ACL for ### Resource Group Access -They can also be Resource ACLs, that limit access to Resources based on Roles and Resource Groups. MODX comes packaged with a default ["Resource" Policy](building-sites/client-proofing/security/policies/permissions/resource-policy "Permissions - Resource Policy") that contains all the basic Permissions one would use in a Resource Group ACL. +They can also be Resource ACLs, that limit access to Resources based on Roles and Resource Groups. MODX comes packaged with a default ["Resource" Policy](building-sites/client-proofing/security/policies/permissions/resource-policy "Resource Policy") that contains all the basic Permissions one would use in a Resource Group ACL. An example would be to assign the "Resource" policy to a Resource Group called 'HR Documents'. Then, you would give a User Group called "HR Department" access to this Resource Group via the Resource ACL: @@ -53,7 +65,7 @@ This would restrict all Resources in the "HR Documents" Resource Group to Users ### Element Category Access -Elements can be restricted from view by ACLs on Categories. For example, if you had a User Group called 'Developers', and wanted Users in that group to be the only Group that could see Elements in the Category 'Gallery', you would create an ACL like such, in the "Element Category Access" tab when editing the User Group: +Elements can be restricted from view by ACLs on Categories. For example, say you have a User Group called 'Developers' and want its Users to be the only ones who see the Elements in the Category 'Gallery'. Create an ACL like this, in the "Element Category Access" tab of the group: ![](acl-ecat1.png) @@ -69,26 +81,26 @@ and its permissions: ![](policy1-perm.png) -Any User that had access to this Policy would have the permissions 'view\_accounts' and 'save\_accounts'. +Any User that had access to this Policy would have the permissions `view_accounts` and `save_accounts`. ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) - 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) - 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) - 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) - 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) - 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/policies/permissions/administrator-policy.md b/en/building-sites/client-proofing/security/policies/permissions/administrator-policy.md index 1fea482f5..53778886f 100644 --- a/en/building-sites/client-proofing/security/policies/permissions/administrator-policy.md +++ b/en/building-sites/client-proofing/security/policies/permissions/administrator-policy.md @@ -1,5 +1,6 @@ --- title: "Administrator Policy" +description: "The Administrator policy of MODX and the full list of the permissions it holds." _old_id: "218" _old_uri: "2.x/administering-your-site/security/policies/permissions/permissions-administrator-policy" --- @@ -10,119 +11,216 @@ This policy is packaged into MODX and is given to users on the 'mgr' context who ## Default Permissions -| Name | Description of Access | -| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| about | The About page. | -| access\_permissions | Any Access Permission-related pages and actions. | -| action\_ok | -| actions | The [Actions](extending-modx/menus/actions "Actions and Menus") page. | -| change\_password | User can change their user password. | -| change\_profile | User can change their profile. | -| content\_types | The [Content Types](building-sites/resources/content-types "Content Types") page. | -| create | Basic "create" access on objects. | -| credits | View the Credits page. | -| customize\_forms | View and manage the [Customizing the Manager](building-sites/client-proofing/form-customization "Customizing the Manager") page. | -| database | The System Info page | -| database\_truncate | The ability to truncate a database table. | -| delete\_category | To delete or remove any Categories. | -| delete\_chunk | To delete or remove any [Chunks](building-sites/elements/chunks "Chunks"). | -| delete\_context | To delete or remove any [Contexts](building-sites/contexts "Contexts"). | -| delete\_document | To delete or remove any [Resources](building-sites/resources "Resources"). | -| delete\_eventlog | To empty the Event Log. | -| delete\_plugin | To delete or remove any [Plugins](extending-modx/plugins "Plugins"). | -| delete\_snippet | To delete or remove any [Snippets](extending-modx/snippets "Snippets"). | -| delete\_template | To delete or remove any [Templates](building-sites/elements/templates "Templates"). | -| delete\_tv | To delete or remove any [Template Variables](building-sites/elements/template-variables "Template Variables"). | -| delete\_role | To delete or remove any [Roles](building-sites/client-proofing/security/roles "Roles"). | -| delete\_user | To delete or remove any [Users](building-sites/client-proofing/security/users "Users"). | -| edit\_category | To edit any Categories. | -| edit\_chunk | To edit any [Chunks](building-sites/elements/chunks "Chunks"). | -| edit\_context | To edit any [Contexts](building-sites/contexts "Contexts"). | -| edit\_document | To edit any [Resources](building-sites/resources "Resources"). | -| edit\_locked | Allows a user to override a lock and edit a locked Resource. | -| edit\_parser | -| edit\_plugin | To edit any [Plugins](extending-modx/plugins "Plugins"). | -| edit\_role | To edit any [Roles](building-sites/client-proofing/security/roles "Roles"). | -| edit\_snippet | To edit any [Snippets](extending-modx/snippets "Snippets"). | -| edit\_template | To edit any [Templates](building-sites/elements/templates "Templates"). | -| edit\_tv | To edit any [Template Variables](building-sites/elements/template-variables "Template Variables"). | -| edit\_user | To edit any [User](building-sites/client-proofing/security/users "Users"). | -| element\_tree | The ability to view the Elements Tree on the left nav. | -| empty\_cache | To empty the site cache. | -| export\_static | To export the site to static HTML. | -| file\_manager | To use the file manager, including creating/deleting files. | -| file\_tree | To view the Files Tree on the left nav. | -| flush\_sessions | Can flush Sessions across the site. | -| frames | To use the MODX Manager UI at all. | -| help | To view the Help page. | -| home | To view the Welcome page. | -| import\_static | To view or use the Import pages. | -| languages | To edit or view Lexicon Languages. | -| lexicons | To edit or view Lexicons and [Internationalization](extending-modx/internationalization "Internationalization"). | -| list | Basic permission to "list" any object. List means to get a collection of objects. | -| load | Basic permission to "load" any object, or be able to return it as an instance at all. | -| logout | To be able to logout as a user. | -| logs | To view the logs, such as error and manager logs. | -| menus | To edit or save any top Menu items. | -| messages | To send or view any personal Messages. | -| namespaces | To edit or view [Namespaces](extending-modx/namespaces "Namespaces"). | -| new\_category | To create a new Category. | -| new\_chunk | To create a new [Chunk](building-sites/elements/chunks "Chunks"). | -| new\_context | To create a new [Context](building-sites/contexts "Contexts"). | -| new\_document | To create a new [Resources](building-sites/resources "Resources"). | -| new\_document\_in\_root | To create a [Resource](building-sites/resources "Resources") at the site root. Replaces the removed `udperms_allowroot` setting. | -| new\_plugin | To create a new [Plugin](extending-modx/plugins "Plugins"). | -| new\_role | To create a new [Role](building-sites/client-proofing/security/roles "Roles"). | -| new\_snippet | To create a new [Snippet](extending-modx/snippets "Snippets"). | -| new\_template | To create a new [Template](building-sites/elements/templates "Templates"). | -| new\_tv | To create a new [Template Variable](building-sites/elements/template-variables "Template Variables"). | -| new\_user | To create a new [User](building-sites/client-proofing/security/users "Users"). | -| packages | To use any Transport Packages in the [Package Management](extending-modx/transport-packages "Package Management") system. | -| property\_sets | To view and edit [Properties and Property Sets](building-sites/properties-and-property-sets "Properties and Property Sets"). | -| providers | To view and edit [Providers](building-sites/extras/providers "Providers") across the site. | -| publish\_document | To publish or unpublish any Resource. In the manager UI this is checked on the **`mgr`** context via `hasPermission('publish_document')`. A grant only on another context does not unlock manager publish controls. See [ACLs](building-sites/client-proofing/security/policies/acls#manager-publishing-and-multiple-groups). | -| purge\_deleted | To empty the Recycle Bin. | -| remove | Basic permission to remove any object. | -| remove\_locks | To remove all existing Locks throughout the site. | -| resource\_tree | To view the Resource Tree in the left nav. | -| save | Basic save permission for any object. | -| save\_category | To save any Categories. | -| save\_chunk | To save any [Chunks](building-sites/elements/chunks "Chunks"). | -| save\_context | To save any [Contexts](building-sites/contexts "Contexts"). | -| save\_document | To save any [Resources](building-sites/resources "Resources"). | -| save\_plugin | To save any [Plugins](extending-modx/plugins "Plugins"). | -| save\_role | To save any [Roles](building-sites/client-proofing/security/roles "Roles"). | -| save\_snippet | To save any [Snippets](extending-modx/snippets "Snippets"). | -| save\_template | To save any [Templates](building-sites/elements/templates "Templates"). | -| save\_tv | To save any [Template Variables](building-sites/elements/template-variables "Template Variables"). | -| save\_user | To save any [User](building-sites/client-proofing/security/users "Users"). | -| search | To use the Search page. | -| settings | To view and edit any System Settings. | -| steal\_locks | To "steal" locks, overriding a current lock on a document. | -| unlock\_element\_properties | To be able to edit the default properties for any Element. | -| view | Basic permission to "view" any object. | -| view\_category | To view any Categories. | -| view\_chunk | To view any [Chunks](building-sites/elements/chunks "Chunks"). | -| view\_context | To view any [Contexts](building-sites/contexts "Contexts"). | -| view\_document | To view any [Resources](building-sites/resources "Resources"). | -| view\_eventlog | To view the Event Log. | -| view\_offline | -| view\_plugin | To view any [Plugins](extending-modx/plugins "Plugins"). | -| view\_role | To view any [Roles](building-sites/client-proofing/security/roles "Roles"). | -| view\_snippet | To view any [Snippets](extending-modx/snippets "Snippets"). | -| view\_template | To view any [Templates](building-sites/elements/templates "Templates"). | -| view\_tv | To view any [Template Variables](building-sites/elements/template-variables "Template Variables"). | -| view\_unpublished | To view any unpublished [Resources](building-sites/resources "Resources"). | -| view\_user | To view any [User](building-sites/client-proofing/security/users "Users"). | -| workspaces | To utilize [Package Management](extending-modx/transport-packages "Package Management"). | +| Name | Description of Access | +| --- | --- | +| `about` | The About page. | +| `access_permissions` | Any Access Permission-related pages and actions. | +| `actions` | The [Actions](extending-modx/menus/actions "Actions and Menus") page. | +| `change_password` | User can change their user password. | +| `change_profile` | User can change their profile. | +| `charsets` | To view a list of charsets. | +| `class_map` | To view a list of classes in the Class Map. | +| `components` | To view the Extras menu. | +| `content_types` | The [Content Types](building-sites/resources/content-types "Content Types") page. | +| `countries` | To view a list of countries. | +| `create` | Basic "create" access on objects. | +| `credits` | View the Credits page. | +| `customize_forms` | View and manage the [Customizing the Manager](building-sites/client-proofing/form-customization "Customizing the Manager") page. | +| `dashboards` | View and manage Custom Dashboards. | +| `database` | The System Info page | +| `database_truncate` | The ability to truncate a database table. | +| `delete_category` | To delete or remove any Categories. | +| `delete_chunk` | To delete or remove any [Chunks](building-sites/elements/chunks "Chunks"). | +| `delete_context` | To delete or remove any [Contexts](building-sites/contexts "Contexts"). | +| `delete_document` | To delete or remove any [Resources](building-sites/resources "Resources"). | +| `delete_eventlog` | To empty the Event Log. | +| `delete_plugin` | To delete or remove any [Plugins](extending-modx/plugins "Plugins"). | +| `delete_propertyset` | To delete or remove any Property Sets. | +| `delete_role` | To delete or remove any [Roles](building-sites/client-proofing/security/roles "Roles"). | +| `delete_snippet` | To delete or remove any [Snippets](extending-modx/snippets "Snippets"). | +| `delete_static_resource` | To delete or remove any static resource, also requires delete\_document permission. | +| `delete_symlink` | To delete or remove any symlink, also requires delete\_document permission. | +| `delete_template` | To delete or remove any [Templates](building-sites/elements/templates "Templates"). | +| `delete_tv` | To delete or remove any [Template Variables](building-sites/elements/template-variables "Template Variables"). | +| `delete_user` | To delete or remove any [Users](building-sites/client-proofing/security/users "Users"). | +| `delete_weblink` | To delete or remove any weblink, also requires delete\_document permission. | +| `directory_chmod` | To chmod a physical directory. | +| `directory_create` | To create a physical directory. | +| `directory_list` | To list subdirectories for a physical directory. | +| `directory_remove` | To delete a physical directory. | +| `directory_update` | To rename a physical directory. | +| `edit_category` | To edit any Categories. | +| `edit_chunk` | To edit any [Chunks](building-sites/elements/chunks "Chunks"). | +| `edit_context` | To edit any [Contexts](building-sites/contexts "Contexts"). | +| `edit_document` | To edit any [Resources](building-sites/resources "Resources"). | +| `edit_locked` | Allows a user to override a lock and edit a locked Resource. | +| `edit_plugin` | To edit any [Plugins](extending-modx/plugins "Plugins"). | +| `edit_propertyset` | To edit any Property Sets. | +| `edit_role` | To edit any [Roles](building-sites/client-proofing/security/roles "Roles"). | +| `edit_snippet` | To edit any [Snippets](extending-modx/snippets "Snippets"). | +| `edit_static_resource` | To edit static resources, also requires edit\_document permission. | +| `edit_symlink` | To edit symlinks, also requires edit\_document permission. | +| `edit_template` | To edit any [Templates](building-sites/elements/templates "Templates"). | +| `edit_tv` | To edit any [Template Variables](building-sites/elements/template-variables "Template Variables"). | +| `edit_user` | To edit any [User](building-sites/client-proofing/security/users "Users"). | +| `edit_weblink` | To edit weblinks, also requires edit\_document permission. | +| `element_tree` | The ability to view the Elements Tree on the left nav. | +| `empty_cache` | To empty the site cache. | +| `error_log_erase` | To erase the error log. | +| `error_log_view` | To view the error log. | +| `events` | To view any System Events. | +| `export_static` | To export the site to static HTML. | +| `file_create` | To create a file. | +| `file_list` | To list files within a given physical directory. | +| `file_manager` | To use the file manager, including creating/deleting files. | +| `file_remove` | To delete physical files. | +| `file_tree` | To view the Files Tree on the left nav. | +| `file_unpack` | To extract zip archives. | +| `file_update` | To edit the content of physical files. WARNING: grants ability to execute arbitrary server-side code. | +| `file_upload` | To upload files to a directory. | +| `file_view` | To view the contents of a file. | +| `flush_sessions` | Can flush Sessions across the site. | +| `frames` | To use the MODX Manager UI at all. | +| `help` | To view the Help page. | +| `home` | To view the Welcome page. | +| `language` | To switch the current language in the manager. | +| `languages` | To edit or view Lexicon Languages. | +| `lexicons` | To edit or view Lexicons and [Internationalization](extending-modx/internationalization "Internationalization"). | +| `list` | Basic permission to "list" any object. List means to get a collection of objects. | +| `load` | Basic permission to "load" any object, or be able to return it as an instance at all. | +| `logout` | To be able to logout as a user. | +| `menu_reports` | Show the main menu item "Reports". | +| `menu_security` | Show the main menu item "Security". | +| `menu_site` | Show the main menu item "Site". | +| `menu_support` | Show the main menu item "Support". | +| `menu_system` | Show the main menu item "System". | +| `menu_tools` | Show the main menu item "Tools". | +| `menu_trash` | Show the main menu item "Trash Manager". | +| `menu_user` | Show the main menu item "User". | +| `menus` | To edit or save any top Menu items. | +| `messages` | To send or view any personal Messages. | +| `mgr_log_erase` | To clear the manager action log. | +| `mgr_log_view` | To view the manager action log. | +| `namespaces` | To edit or view [Namespaces](extending-modx/namespaces "Namespaces"). | +| `new_category` | To create a new Category. | +| `new_chunk` | To create a new [Chunk](building-sites/elements/chunks "Chunks"). | +| `new_context` | To create a new [Context](building-sites/contexts "Contexts"). | +| `new_document` | To create a new [Resources](building-sites/resources "Resources"). | +| `new_document_in_root` | To create a [Resource](building-sites/resources "Resources") at the site root. Replaces the removed `udperms_allowroot` setting. | +| `new_plugin` | To create a new [Plugin](extending-modx/plugins "Plugins"). | +| `new_propertyset` | To create a new Property Set. | +| `new_role` | To create a new [Role](building-sites/client-proofing/security/roles "Roles"). | +| `new_snippet` | To create a new [Snippet](extending-modx/snippets "Snippets"). | +| `new_static_resource` | To create a new Static Resource. | +| `new_symlink` | To create a new SymLink. | +| `new_template` | To create a new [Template](building-sites/elements/templates "Templates"). | +| `new_tv` | To create a new [Template Variable](building-sites/elements/template-variables "Template Variables"). | +| `new_user` | To create a new [User](building-sites/client-proofing/security/users "Users"). | +| `new_weblink` | To create a new WebLink. | +| `packages` | To use any Transport Packages in the [Package Management](extending-modx/transport-packages "Package Management") system. | +| `policy_delete` | To delete an Access Policy. | +| `policy_edit` | To edit an Access Policy. WARNING: combined with policy\_save permission, grants ability to escalate privileges, including security-related permissions. | +| `policy_new` | To create a new Access Policy. | +| `policy_save` | To save an Access Policy. | +| `policy_template_delete` | To delete an Access Policy Template. | +| `policy_template_edit` | To edit an Access Policy Template. | +| `policy_template_new` | To create a new Access Policy Template. | +| `policy_template_save` | To save an Access Policy Template. | +| `policy_template_view` | To view an Access Policy Template. | +| `policy_view` | To view an Access Policy. | +| `property_sets` | To view and edit [Properties and Property Sets](building-sites/properties-and-property-sets "Properties and Property Sets"). | +| `providers` | To view and edit [Providers](building-sites/extras/providers "Providers") across the site. | +| `publish_document` | To publish or unpublish any Resource. In the manager UI this is checked on the **`mgr`** context via `hasPermission('publish_document')`. A grant only on another context does not unlock manager publish controls. See [ACLs](building-sites/client-proofing/security/policies/acls#manager-publishing-and-multiple-groups). | +| `purge_deleted` | To empty the Recycle Bin. | +| `remove` | Basic permission to remove any object. | +| `remove_locks` | To remove all existing Locks throughout the site. | +| `resource_duplicate` | To duplicate a Resource. | +| `resource_quick_create` | To be able to use Quick Create Resource in the left-hand tree. | +| `resource_quick_update` | To be able to use Quick Edit Resource in the left-hand tree. | +| `resource_tree` | To view the Resource Tree in the left nav. | +| `resourcegroup_delete` | To delete a Resource Group. | +| `resourcegroup_edit` | To edit a Resource Group. | +| `resourcegroup_new` | To create a new Resource Group. | +| `resourcegroup_resource_edit` | To edit Resources in a Resource Group. | +| `resourcegroup_resource_list` | To view or list Resources in a Resource Group. | +| `resourcegroup_save` | To save a Resource Group. | +| `resourcegroup_view` | To list Resource Groups. | +| `save` | Basic save permission for any object. | +| `save_category` | To save any Categories. | +| `save_chunk` | To save any [Chunks](building-sites/elements/chunks "Chunks"). | +| `save_context` | To save any [Contexts](building-sites/contexts "Contexts"). | +| `save_document` | To save any [Resources](building-sites/resources "Resources"). | +| `save_plugin` | To save any [Plugins](extending-modx/plugins "Plugins"). | +| `save_propertyset` | To save any Property Sets. | +| `save_role` | To save any [Roles](building-sites/client-proofing/security/roles "Roles"). | +| `save_snippet` | To save any [Snippets](extending-modx/snippets "Snippets"). | +| `save_template` | To save any [Templates](building-sites/elements/templates "Templates"). | +| `save_tv` | To save any [Template Variables](building-sites/elements/template-variables "Template Variables"). | +| `save_user` | To save any [User](building-sites/client-proofing/security/users "Users"). | +| `search` | To use the Search page. | +| `set_sudo` | To make any User sudo. | +| `settings` | To view and edit any System Settings. | +| `source_delete` | To delete a Media Source. | +| `source_edit` | To edit a Media Source. | +| `source_save` | To create or save a Media Source. | +| `source_view` | To view and list Media Sources. | +| `sources` | To manage Media Sources and Media Source Types. | +| `steal_locks` | To "steal" locks, overriding a current lock on a document. | +| `tree_show_element_ids` | Show the IDs in the Elements tree. | +| `tree_show_resource_ids` | Show the IDs in the Resource tree. | +| `undelete_document` | To undelete any Resource. | +| `unlock_element_properties` | To be able to edit the default properties for any Element. | +| `unpublish_document` | To unpublish any Resources. | +| `usergroup_delete` | To delete a User Group. | +| `usergroup_edit` | To edit a User Group. WARNING: exposes UserGroup Settings which can override security-related System Settings, such as uploadable file types and API credentials. | +| `usergroup_new` | To create a new User Group. | +| `usergroup_save` | To save a User Group. | +| `usergroup_user_edit` | To edit Users in a User Group. | +| `usergroup_user_list` | To view or list Users in a User Group. | +| `usergroup_view` | To view a User Group. | +| `view` | Basic permission to "view" any object. | +| `view_category` | To view any Categories. | +| `view_chunk` | To view any [Chunks](building-sites/elements/chunks "Chunks"). | +| `view_context` | To view any [Contexts](building-sites/contexts "Contexts"). | +| `view_document` | To view any [Resources](building-sites/resources "Resources"). | +| `view_element` | To get a list of Elements or Element classes. | +| `view_eventlog` | To view the Event Log. | +| `view_offline` | To be able to view the site when it is in offline status. | +| `view_plugin` | To view any [Plugins](extending-modx/plugins "Plugins"). | +| `view_propertyset` | To view any Property Sets. | +| `view_role` | To view any [Roles](building-sites/client-proofing/security/roles "Roles"). | +| `view_snippet` | To view any [Snippets](extending-modx/snippets "Snippets"). | +| `view_sysinfo` | To view the system info page. | +| `view_template` | To view any [Templates](building-sites/elements/templates "Templates"). | +| `view_tv` | To view any [Template Variables](building-sites/elements/template-variables "Template Variables"). | +| `view_unpublished` | To view any unpublished [Resources](building-sites/resources "Resources"). | +| `view_user` | To view any [User](building-sites/client-proofing/security/users "Users"). | +| `workspaces` | To utilize [Package Management](extending-modx/transport-packages "Package Management"). | ## Custom Permissions -If you have created your own actions and menu items (e.g. if you have created a [Custom Manager Page](extending-modx/custom-manager-pages "Custom Manager Pages Tutorial")), then you can define custom permission items when you create the menu item (System --> Actions --> Create Menu) that correspond to permissions listed here. +If you have created your own actions and menu items (e.g. a [Custom Manager Page](extending-modx/custom-manager-pages "Custom Manager Pages Tutorial")), then you can define custom permission items for them. Create the menu item (**Admin → Actions → Create Menu**) and let the permission items match those listed here. ![](modx+custom+permission.jpg) ## See Also -1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) -2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/policies/permissions/index.md b/en/building-sites/client-proofing/security/policies/permissions/index.md index 4c1bfdf3e..f5987259d 100644 --- a/en/building-sites/client-proofing/security/policies/permissions/index.md +++ b/en/building-sites/client-proofing/security/policies/permissions/index.md @@ -1,48 +1,49 @@ --- title: "Permissions" +description: "The permissions of MODX: what a single permission is, and how the policies group them." _old_id: "217" _old_uri: "2.x/administering-your-site/security/policies/permissions" --- ## What is a Permission? -A Permission in Revolution is a single access control that allows or denies execution of a single task. You can think of a permission as a checkbox: can a user perform an action or not? +A Permission in MODX is a single access control that allows or denies execution of a single task. You can think of a permission as a checkbox: can a user perform an action or not? -An example Permission is "content\_types" - if a user's Policy does not contain this Permission, then the user will not be able to perform that action. In this case, the user can not view the Content Types page. +An example Permission is `content_types`: if a user's Policy does not contain it, the user cannot perform that action. In this case, the user can not view the Content Types page. -Normally you don't deal with permissions individually, but in groups called [Access Policies](building-sites/client-proofing/security/policies "Policies"). An [Access Policy](building-sites/client-proofing/security/policies "Policies") is a list of individual permissions (also called an Access Control List or ACL). For example, if you need to grant users the permissions necessary to edit content in the manager, you can assign them to use the "Content Editor" policy. +Normally you don't deal with permissions individually, but in groups called [Access Policies](building-sites/client-proofing/security/policies "Policies"). An [Access Policy](building-sites/client-proofing/security/policies "Policies") is a list of individual permissions (also called an Access Control List or ACL). For example, to grant users the permissions needed to edit content in the manager, assign them the "Content Editor" policy. -MODX permissions are always additive: if a permission exists on "Access Policy A" and not on "Access Policy B" and you add both policies to a user, the effective policy is a collection of all the permissions defined in both policies. Adding more policies will never remove permissions for a user. For example, if you add a limited "Load Only" policy to an administrator user, the administrator user will still be able to do all the things defined in the Administrator policy. +MODX permissions are always additive. If a permission exists on "Access Policy A" and not on "Access Policy B", and you add both policies to a user, the effective policy holds the permissions of both. Adding more policies will never remove permissions for a user. For example, if you add a limited "Load Only" policy to an administrator user, that user still can do everything the Administrator policy defines. ## Usage In practice, Access Policies are associated with User Groups (not with individual users). Access Policies are associated with a User Group, and users may be added to the group. -Access Policies (ACLs) define lists of permissions (see Menu --> Access Controls). These lists contain groups of permissions that belong together. +Access Policies (ACLs) define lists of permissions (see the lock icon in the user menu → **Access Control Lists**). These lists contain groups of permissions that belong together. -1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) -2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) +1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) +2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + +Policy Templates organize the lists of permissions in the Access Policies. An Access Policy is a list of checkboxes, the Policy Templates define which checkboxes are available for an Access Policy. Because the full list of permissions may be quite long, it's not efficient to define Access Policies while having to wade through hundreds of checkboxes. Policy Templates allow you to narrow down the options available to an Access Policy. ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) - -There are also "Policy Templates" -- these help organize the lists of permission in the Access Policies. An Access Policy is a list of checkboxes, the Policy Templates define which checkboxes are available for an Access Policy. Because the full list of permissions may be quite long, it's not efficient to define Access Policies while having to wade through hundreds of checkboxes. Policy Templates allow you to narrow down the options available to an Access Policy. diff --git a/en/building-sites/client-proofing/security/policies/permissions/resource-policy.md b/en/building-sites/client-proofing/security/policies/permissions/resource-policy.md index 73c778b03..0e43bc8e8 100644 --- a/en/building-sites/client-proofing/security/policies/permissions/resource-policy.md +++ b/en/building-sites/client-proofing/security/policies/permissions/resource-policy.md @@ -1,5 +1,6 @@ --- title: "Resource Policy" +description: "The Resource policy of MODX and the permissions it holds." _old_id: "219" _old_uri: "2.x/administering-your-site/security/policies/permissions/permissions-resource-policy" --- @@ -11,24 +12,42 @@ This policy is packaged into MODX and is given to users on any context who want ## Default Permissions | Name | -|------| -| add\_children | -| create | -| delete | -| list | -| load | -| move | -| publish | -| remove | -| save | -| steal\_lock | -| undelete | -| unpublish | -| view | +| --- | +| `add_children` | +| `copy` | +| `create` | +| `delete` | +| `list` | +| `load` | +| `move` | +| `publish` | +| `remove` | +| `save` | +| `steal_lock` | +| `undelete` | +| `unpublish` | +| `view` | Do not confuse Resource permissions `publish` / `unpublish` with Administrator/context permission `publish_document`. The manager publish checkbox, dates, tree actions, and publish processors gate on `publish_document` for the **`mgr`** context. Resource `publish` / `unpublish` alone will not open those controls. See [ACLs: Manager publishing and multiple groups](building-sites/client-proofing/security/policies/acls#manager-publishing-and-multiple-groups). ## See Also -1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) -2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/policies/policytemplates.md b/en/building-sites/client-proofing/security/policies/policytemplates.md index d51fe741b..609f22fe0 100644 --- a/en/building-sites/client-proofing/security/policies/policytemplates.md +++ b/en/building-sites/client-proofing/security/policies/policytemplates.md @@ -1,18 +1,19 @@ --- title: "PolicyTemplates" +description: "The policy templates of MODX and the groups that organise them." _old_id: "244" _old_uri: "2.x/administering-your-site/security/policies/policytemplates" --- ## What are Policy Templates? -Policy Templates define which permissions are _available_ to an [Access Policy](building-sites/client-proofing/security/policies "Policies"). A Policy Template does not say if a permission is actually granted or denied (the Access Policy does that), it just defines which permissions the Access Policy should be able to check or uncheck. Having a Policy Template is useful if need to narrow down the list of available permissions you want to define in an Access Policy. +Policy Templates define which permissions are _available_ to an [Access Policy](building-sites/client-proofing/security/policies "Policies"). A Policy Template does not say if a permission is granted or denied (the Access Policy does that). It only defines which permissions the Access Policy can check or uncheck. Having a Policy Template is useful if need to narrow down the list of available permissions you want to define in an Access Policy. Although there is some overlap between the specific permissions defined in each policy template, each template contains _mostly_ unique permissions. Each template defines all the permissions that apply to the Access Control Lists (ACLs) they target; each is meant to be self-contained. ### AdministratorTemplate -Defines all permissions for working in the MODX manager. In other words, it defines what actions can be taken from a context. Generally policies based on this template are not used in contexts other than manager unless users need to execute processors from them (like front-end extension). [See all Administrator Policy Permissions](building-sites/client-proofing/security/policies/permissions/administrator-policy "Permissions - Administrator Policy") +Defines all permissions for working in the MODX manager. In other words, it defines what actions can be taken from a context. Generally policies based on this template are not used in contexts other than manager unless users need to execute processors from them (like front-end extension). [See all Administrator Policy Permissions](building-sites/client-proofing/security/policies/permissions/administrator-policy "Administrator Policy") ### ElementTemplate @@ -28,30 +29,48 @@ Generic xPDOObject permissions for any modAccessibleObject to make use of. ### ResourceTemplate -Resource defines extra permissions associated with Resource Group ACLs. [See all Resource Policy permissions](building-sites/client-proofing/security/policies/permissions/resource-policy "Permissions - Resource Policy") +Resource defines extra permissions associated with Resource Group ACLs. [See all Resource Policy permissions](building-sites/client-proofing/security/policies/permissions/resource-policy "Resource Policy") ### ContextTemplate Context defines context access when administration actions are not involved. +### NamespaceTemplate + +Namespace holds the three permissions of a namespace: `list`, `load` and `view`. + +## Policy Template Groups + +The templates are put into groups, and the group decides in which part of the list of the policies a policy shows up. MODX 3 ships with seven groups: + +| Group | The templates in it | +| --- | --- | +| Administrator | AdministratorTemplate | +| Object | ObjectTemplate | +| Resource | ResourceTemplate | +| Element | ElementTemplate | +| MediaSource | MediaSourceTemplate | +| Namespace | NamespaceTemplate | +| Context | ContextTemplate | + ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/resource-groups.md b/en/building-sites/client-proofing/security/resource-groups.md index ff7428b02..2c8b30444 100644 --- a/en/building-sites/client-proofing/security/resource-groups.md +++ b/en/building-sites/client-proofing/security/resource-groups.md @@ -1,5 +1,6 @@ --- title: "Resource Groups" +description: "The resource groups of MODX: how they collect the resources and how a group gets access to them." _old_id: "261" _old_uri: "2.x/administering-your-site/security/resource-groups" --- @@ -14,7 +15,7 @@ You can manage the pages in a Resource Group in two different ways: ### Option 1 -Go to Security -> Resource Groups. From there you will see a list of all defined Resource Groups and a tree of Resources. +Go to the lock icon in the user menu → **Resource Groups**. From there you will see a list of all defined Resource Groups and a tree of Resources. Drag the Resources from the right tree directly into Resource Groups in the left tree: @@ -30,22 +31,22 @@ Membership alone does not hide the page. You still need a User Group and an ACL ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/roles.md b/en/building-sites/client-proofing/security/roles.md index 307b875d8..fff24041b 100644 --- a/en/building-sites/client-proofing/security/roles.md +++ b/en/building-sites/client-proofing/security/roles.md @@ -1,66 +1,87 @@ --- title: "Roles" +description: "The roles of MODX: the number of authority they carry and how it is compared with the access of a group." _old_id: "268" _old_uri: "2.x/administering-your-site/security/roles" --- ## What is a Role? -A role is a position or status held within a certain situation. In MODX, it can be used to group Users into a position or status within a User Group, e.g. "Editor" or "Front-end Read Only". +A Role groups the Users of a User Group by position or status, e.g. "Editor" or "Front-end Read Only". -Roles in MODX use an integer value called "Authority". **Lower numbers represent a stronger authority.** E.g. a Role with Authority 10 will inherit any and all Group Policies assigned to itself and to any roles defined with Authority 11, but a user Role with Authority 11 does NOT inherit any of the Group Policies from Role 10. +Roles use an integer value called "Authority". **Lower numbers represent a stronger authority.** A user passes the check of an ACL when the authority of their role is **not greater** than the authority of the ACL. A user with a role of authority 10 passes every ACL that a user with a role of authority 11 passes. -Be sure you clarify your language when talking about Authority because this inverse relationship can lead to some confusing sentences. +Think of Authority as an ordinal: first, second, third. **Authority=1** is the first authority and trumps **Authority=2**. -It helps to think of "Authority" as ordinal numbers: first, second, third, etc. **Authority=1** is the first authority and trumps **Authority=2** (i.e. the second authority). +**The authority numbers are unique** +The database will not let you create two roles with the same authority: the column has a unique index. -You should generally avoid duplicate authority numbers. +## The Roles of MODX + +MODX 3 ships with two roles: + +| Role | Authority | +| --- | --- | +| Member | 9999 | +| Super User | 0 | + +The role **Super User** passes the check of every ACL, because the authority of an ACL is never below 0. The role **Member** passes only the ACLs whose authority is 9999 or more. + +## The Permissions of the Page + +The roles page needs these permissions: + +| Permission | What it allows | +| --- | --- | +| `view_role` | See the list. | +| `new_role`, `save_role` | Create a role. | +| `edit_role` | Change a role. | +| `delete_role` | Delete a role. | ## Usage -One common example is to create Roles that mimic a basic employee position structure. Let's say we create the following Roles and Authority levels: +Create roles that follow job titles. Authority has to be unique. Super User already uses 0, and Member already uses 9999. -- Administrator - 0 - Director - 1 - Coordinator - 2 - Supervisor - 3 -- Employee - 9999 +- Employee - 10 ![](roles-grid.png) -We can then create a User Group called "HR Department". Within that User Group, we'll assign Users to those Roles (you can have multiple Users per Role, as well). +Create a User Group called "HR Department" and assign users to those roles. Several users can share one role. -Now, let's say John has a Role of Coordinator. Mark has a Role of Supervisor. We're going to give Mark's "HR Deparment" User Group an Access Policy (which is a set of Permissions) called "AccountPolicy" that has the following Access Permissions in it: +John's role is Coordinator. Mark's role is Supervisor. Give the "HR Department" User Group an Access Policy called "AccountPolicy" on the "web" context, and set Minimum Role to "Supervisor": -- view\_accounts -- save\_accounts +![](ug-ctx-grid1.png) -We've assigned this Policy to the "web" context for our User Group "HR Department". We then set its Minimum Role value to "Supervisor": +The policy holds these permissions: -![](ug-ctx-grid1.png) +- `view_accounts` +- `save_accounts` -This means that Mark has these Permissions, since he's in the User Group, and has at least the Role of "Supervisor" (which is the Role he has, specifically). +Mark has these permissions. He is in the User Group, and his role is at least "Supervisor". -But this **also** means that John has these Permissions as well, since he is a "Coordinator" which has a stronger Authority level than "Supervisor". So, John as Coordinator has "inherited" the Permissions than Mark had as Supervisor. +John has them too. Coordinator has a stronger authority than Supervisor, so John has the permissions Mark has as Supervisor. ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md b/en/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md index 349f8a7fb..d070ab7a7 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md +++ b/en/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md @@ -1,32 +1,35 @@ --- title: "Creating a Second Super Admin User" +description: "Create a second administrator of MODX, with the group and the role that give the rights." _old_id: "74" _old_uri: "2.x/administering-your-site/security/security-tutorials/creating-a-second-super-admin-user" --- ## The Problem -You want another MODX Revolution User to have full manager access, with all the [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") of an Administrator user. Perhaps it's your colleague or your client, but by creating another Administrator, you are handing over the keys to the _entire_ site. This is a simplistic scenario: the other admin would be able to modify or delete your user, so it may not be a viable solution for what you need to do. In the process of walking users through this task, this page gives a brief introduction to roles and access policies. +You want another User to have full manager access, with all the [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") of an Administrator user. Perhaps it's your colleague or your client, but by creating another Administrator you are handing over the keys to the _entire_ site. This is a simplistic scenario. The other admin could modify or delete your user, so this may not be a viable solution for what you need. + +To give a user manager access on a smaller scale, see [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access "Giving a User Manager Access"). Shaun McCormick's video on [Understanding MODX Revolution Security](http://vimeo.com/13856994) walks through setting up complex permission schemes. ## The Solution After logging into your site's manager, do the following: -1. Create a new user: Manage -> Users -> New User (Button) +1. Create a new user: the lock icon in the user menu → **Users** -> New User (Button) 2. Be sure you give the new user a unique username, password, and email. -3. Before saving the user, click the tab marked **Access Permissions** and click the button marked **Add User Group to User** +3. Before saving the user, click the tab marked **Access Permissions** and click the button marked **Add User to Group** 1. **User Group:**`Administrator` 2. **Role:**`Super User` -4. Save the user. (You can always return to Security -> Manage Users and right-click the user to update the properties). +4. Save the user. (You can always return to the lock icon in the user menu → **Users** and right-click the user to update the properties). 5. Try logging in to the manager using a different browser to verify that the login works. ## Why can't I add another Administrator with a different [Role](building-sites/client-proofing/security/roles "Roles"), e.g. a "Member"? -Try it. When you try to login using the other username with only a "Member" role, permission will be denied. But why? It has to do with [Context Access](building-sites/contexts "Contexts") and [Access Policies](building-sites/client-proofing/security/policies "Policies"), which get a lot more complicated in a hurry. If you have a look at Security -> Access Controls and then right-click the Administrator User Group -> Update User Group, then click on the **Context Access** tab. You'll see something like this: +Try it. When you try to login using the other username with only a "Member" role, permission will be denied. But why? It has to do with [Context Access](building-sites/contexts "Contexts") and [Access Policies](building-sites/client-proofing/security/policies "Policies"), which get a lot more complicated in a hurry. Have a look at the lock icon in the user menu → **Access Control Lists**, right-click the Administrator User Group -> Update User Group, then click **Context Access**. You'll see something like this: ![](user-group-perms.jpg) -By default, MODX Revolution has 2 contexts: **web** (the front-end) and **mgr** (the back-end). From this table, we can learn 2 things: that the _minimum_ role is the Super-User role, and the "Access Policy" in use for this context is "Administrator". Even if you don't understand what all of that means, this is a good place to start educating you about permissions. +By default, MODX has 2 contexts: **web** (the front-end) and **mgr** (the back-end). From this table we can learn 2 things: the _minimum_ role is the Super-User role, and the "Access Policy" for this context is "Administrator". Even if you don't understand what all of that means, this is a good place to start educating you about permissions. ### Minimum Role @@ -34,18 +37,28 @@ From the Context Access screen, you can see that you have to be at least a "Supe ### Roles -While we're at it, why would you want to give another user another role if he or she was going to have the _exact_ same privileges as you? Technically speaking, if they have the exact same privileges, then their role is equivalent to yours. In other words, you don't need a new role. +While we're at it, why give another user another role if they are going to have the _exact_ same privileges as you? Technically speaking, if they have the exact same privileges, then their role is equivalent to yours. In other words, you don't need a new role. When thinking about roles, think about that access policy there. The access policy says what your user can and can't do if you are assigned a particular role. ## See Also -See the other tutorial about [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access "Giving a User Manager Access") for an example of how to create a user with a permission level of less than you. - -Shaun McCormick's video on [Understanding MODX Revolution Security](http://vimeo.com/13856994) gives a detailed walk-through of setting up some complex permission schemes. - -1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md b/en/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md index e7dfc35ac..3a70ca34e 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md +++ b/en/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md @@ -1,24 +1,25 @@ --- title: "Giving a User Manager Access" +description: "Give a user in MODX the rights of a manager: the group, the roles and the policy that do it." _old_id: "155" _old_uri: "2.x/administering-your-site/security/security-tutorials/giving-a-user-manager-access" --- ## The Problem - You want a User to have manager editing access, but not have all the [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") of an Administrator user. This tutorial, partially written by BobRay, will help you through that. +You want a user to edit in the manager, and not have all the [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") of an Administrator user. Part of this tutorial was written by BobRay. ## The Solution -1. In Access Controls ->Roles, create a new role (lets call it "Editor") with an authority of 10. -2. In Settings -> Access Control Lists -> Access Policies, duplicate the administrator policy and rename it to whatever you want, for our example we'll use "AdminLite". +1. In the lock icon → **Access Control Lists**, open the **Roles** tab and create a role (call it "Editor") with an authority of 10. +2. On the **Access Policies** tab, duplicate the administrator policy and rename it. For our example we'll use "AdminLite". 3. Edit the AdminLite Policy to use whatever [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") you want the User to have. -4. In Settings -> Access Control Lists -> User Groups, right click on the "Administrator" group and select "Update User Group." -5. On the Permissions -> Context Access tab, add two new entries to the grid: +4. On the tab **User Groups & Users**, right-click the "Administrator" group and select **Edit User Group**. +5. On the **Contexts** tab, click **Add Context Access** and add two entries: 1. Context: 'mgr' Minimum Role: 'Editor', Access Policy 'AdminLite' 2. Context: 'web' Minimum Role: 'Editor', Access Policy 'Load, List and View' -6. In Manage -> Users, create the new user, or edit existing, and via the Access Permissions tab, assign them to the Administrator group with a role of Editor. -7. Click on Security -> Flush Sessions and re-login. +6. In the lock icon in the user menu → **Users**, create the new user or edit an existing one. On the Access Permissions tab, assign them to the Administrator group with a role of Editor. +7. Click on **Logout All Users** and re-login. ## Publishing in the manager @@ -32,8 +33,22 @@ More detail: [ACLs: Manager publishing and multiple groups](building-sites/clien ## See Also -1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) \ No newline at end of file +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/security-tutorials/index.md b/en/building-sites/client-proofing/security/security-tutorials/index.md index d9e89cb46..108bde423 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/index.md +++ b/en/building-sites/client-proofing/security/security-tutorials/index.md @@ -1,5 +1,6 @@ --- title: "Security Tutorials" +description: "The tutorials of the security section of MODX: member-only pages, managers, the anonymous user and the access to the elements." _old_id: "271" _old_uri: "2.x/administering-your-site/security/security-tutorials" --- diff --git a/en/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md b/en/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md index 2843a74e0..b891d2cc0 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md +++ b/en/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md @@ -1,134 +1,96 @@ --- title: "Making Member-Only Pages" +description: "Protect the pages of a MODX site so that only the members of a group can see them." _old_id: "186" _old_uri: "2.x/administering-your-site/security/security-tutorials/making-member-only-pages" --- -## Introduction +## The Steps -MODX Revolution uses a whole new set of security systems to allow you more flexibility while giving your users access (or denying) to Manager and Web resources. As there seems to be need for a proper tutorial to get you into the basics of working with this advanced system this document has been written. +These steps protect front-end pages so that only certain users can see them. They assume users already register and log in with the [Login](/extras/login "Login") package. They do not change which resources a user can see or edit in the manager. -It's common to have pages in the front end of a site that can only be seen by certain users. This tutorial describes how to do that in MODX Revolution. It assumes that you already know how to let users register and log in using the components in the [Login](/extras/login "Login") package. The process described below will have no effect on which resources users can see or edit in the MODX Manager. - -For those that are savvy enough, below follows a simple list to help you through the maze or to remind you how it works. If you need more information and would like some examples, scroll down to the related subsection below. - -1. Create a Resource Group (Security -> Resource Groups -> Create Resource Group) +1. Create a Resource Group (the lock icon in the user menu → **Resource Groups** → **Create Resource Group**) 2. Link your member-only resource to the Resource Group. (By editing the resource, or by dragging them from the resource tree to the right) -3. Create a User Group (Security -> Access Controls -> User Groups -> New User Group) +3. Create a User Group (the lock icon in the user menu → **Access Control Lists** → the tab **User Groups & Users** -> New User Group) 4. Add a resource group entry on the Resource Group Access tab (context: web, minimum role: Member (9999), access policy: Resource) -5. Add users to the user group with the role of Member. (Security -> Manage Users) -6. Flush permissions (Security -> Flush Permissions) and try it in another browser (not just another browser window: another browser) +5. Add users to the user group with the role of Member. (the lock icon in the user menu → **Users**) +6. Flush permissions (**Flush Your Permissions**) and try it in another browser (not just another browser window: another browser) -## Access Wizard explanation (2.2.2 and later) +## Access Wizard -MODX 2.2.2 ships with an access wizard that simplifies this process. The step-by-step explanation is still valid, but the access wizard simplifies the process. You may wish to read both explanations to gain a better understanding of how each aspect of MODX's security system interacts. +The wizard of the resource group walks you through the whole process. The result is the same as when you set every step by hand. ### 1. Create a Resource Group -Go to Security -> Resouce Groups and click the Create Resource Group. A window similar to this should pop up: ![](create-resource-group.png) +A [Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") is a collection of resources you can link to user groups and access list entries. -Let's go over each section: +Go to the lock icon in the user menu → **Resource Groups** and click **Create Resource Group**. A window similar to this should pop up: ![](create-resource-group.png) -| Section | Explanation | Tutorial Default | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| Name | This is the name of the resource group that we're generating. Make it descriptive and easy-to-remember. | Protected | -| Contexts | This is the context where you want the rules to apply. For this tutorial, we only have one context, "web", and we only want to hide things there. | web | -| Automatically give Administrator Group Access | Checking this box will give all users in the default administrator group access to the resource group. As of 2.2.1, the default admin user is marked as a "sudo" user and they can view all resource groups, regardless of whether the administrator group has access. However, if there are any other administrators that don't have sudo access and we want them to be able to view the resources in the resource group, we should check that box. | checked | -| Automatically give Anonymous Group Access | Checking this box will give all users in the anonymous user group access to the resource group. When someone comes to your website and they're not logged into anywhere, they're considered in the anonymous user group. We want to protect our pages from users who aren't logged in, so let's leave this box unchecked for this tutorial. | unchecked | -| Create Parallel User Group | You may not wish to have everyone who can view the member-only pages be in the administrator group (if you've checked the "Automatically give Administrator Group Access" option). In this case, you can create another user group that has access to the resources in this resource group. Let's check that, as our members aren't administrators. | checked | -| Automatically Give Other User Groups Access | If you have any other user groups that you've defined previously to this tutorial to whom you want to give access, you can list them here. | | - -Great! We have a resource group and a user group created. We now need to add resources to the resource group and users to that user group and then we'll be laughing. +| Section | Explanation | Tutorial Default | +| --- | --- | --- | +| Name | The name of the resource group that we're generating. Make it descriptive and easy-to-remember. | Protected | +| Contexts | The context where you want the rules to apply. For this tutorial, we only have one context, "web", and we only want to hide things there. | web | +| Automatically give Administrator Group Access | Checking this box gives every user in the default administrator group access to the resource group. The default admin user is marked as a "sudo" user. A sudo user bypasses the checks of the policies, so they see every resource group whether or not the administrator group has access. Check the box if other administrators lack sudo and should see the resources in the group. | checked | +| Automatically give Anonymous Group Access | Checking this box will give the anonymous user access to the resource group. When someone comes to your website and is not logged in, they are the anonymous user. We want to protect our pages from users who aren't logged in, so let's leave this box unchecked for this tutorial. | unchecked | +| Create Parallel User Group | You may not wish to have everyone who can view the member-only pages be in the administrator group (if you've checked the "Automatically give Administrator Group Access" option). In this case, you can create another user group that has access to the resources in this resource group. Let's check that, as our members aren't administrators. | checked | +| Automatically Give Other User Groups Access | If you have any other user groups that you've defined previously to this tutorial to whom you want to give access, you can list them here. | | ### 2. Add Resources to the Resource Group -Tell MODX which Resources to protect. Stay on the page from Step 1 (Security > Resource Groups). On the right, open the web context to see the pages on your site. Drag them from the right column into your Resource Group. Or edit each Resource, open the Resource Groups tab, and check **Access** on the "Protected" row. +Tell MODX which Resources to protect. Stay on the page from Step 1 (the lock icon in the user menu → **Resource Groups**). On the right, open the web context to see the pages on your site. Drag them from the right column into your Resource Group. Or edit each Resource, open the Resource Groups tab, and check **Access** on the "Protected" row. ### 3. Add Users to the User Group -Okay, we've had enough of the Resource Group page. Go to Security > Access Controls. In the Users Groups tab, we can see a list of all of the user groups on our site. Right click on the "Protected" User group. Select "Add User to Group". For the "Name", select the user you want in the user group. For the Role, let's select "Member" for now. Roles define what an individual user can do within a user group, but we don't need that fine of control for this tutorial. Click Save. +Go to the lock icon in the user menu → **Access Control Lists**. On the **User Groups & Users** tab you see the user groups. Right-click the "Protected" group and select **Add User to Group**. For the "Name", select the user you want in the user group. For the Role, let's select "Member" for now. Roles define what an individual user can do within a user group, but we don't need that fine of control for this tutorial. Click Save. -It is important to realize that as soon as you have protected a resource by (1) assigning it to one or more resource groups and (2) linking the resource group to a user group using an access control, those pages will no longer show up for users that are not linked to the resource group. The default behavior in that case is displaying the 404-error page. If you would rather return the 401-error, you will need to give the anonymous user group "load" permission for the resource group. More about this in a later tutorial. At this moment in the tutorial, your page will not be visible as you have not yet added it to a user group. +A resource is protected when it is assigned to one or more resource groups. That group is linked to a user group with an access control. Those pages no longer show for users who are not linked to it. The default page is the 404 error. To return 401 instead, give the anonymous user "load" permission for the resource group. More on that in a later tutorial. At this point the page is still not visible, because you have not added it to a user group. -We now have our resources in a resource group, and users in a user group. Done? Sorry, we have a few small things to do first. If you're following this tutorial and this is your first foray into MODX security, you will likely run into a small but important snag: the user group we created doesn't have context access to our front end context, web. In other words, if we could view that context, we could view those protected resources -- but we can't currently view that context. Let's give our user group permission to view that context. +When you use a websignup snippet, make sure it puts the new users into the right user group. -### 4. Add Context Access to the User Group +The user group has no context access to the front-end context, web. If that context were available, the protected resources would be available too. It is not available yet. Add that access next. -Go to Security > Access Controls. Right click on the protected user group. Select "Update user group". Go to the Context Access tab. Click "Add Context". We are presented with a dialog such as the one below. Let's break it down: ![](context-access.png) +### 4. Add Context Access to the User Group -| Section | Explanation | Tutorial Default | -| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| Context | This specifies to which context we're giving access. The basic use case will have web and mgr. Web is the public front-end of your website, and mgr is the private back-end of your website (i.e., the manager that you're logged in). | web | -| Minimum Role | This specifies what user roles this rule will apply to. If we want all users in this user group, select "Member - 9999". This is where some of that fine control comes in that we talked about earlier. | Member - 9999 | -| Access Policy | This specifies what permissions we're giving to the users. Different policies will allow user groups to do different things. | Administrator | +Go to the lock icon → **Access Control Lists**. Right-click the protected user group and select **Edit User Group**. Open the **Contexts** tab and click **Add Context Access**. The dialog has these fields: ![](context-access.png) -Let's make one rule with "web", "Member - 9999", and "Load, List and View". If we want users to be able to view the MODX manager, we can add a second rule to give them access to the mgr context: "mgr", "Member - 9999", and "Administrator". All these users will have admin access. If you would prefer to limit their permissions, you could instead choose "Content Editor" or "Developer" for their access policies. Alternatively, you can make your own in Security > Access Policies if you want to be specific about what users can or can't do. +| Section | Explanation | Tutorial Default | +| --- | --- | --- | +| Context | This specifies to which context we're giving access. The basic use case will have web and mgr. Web is the public front-end of your website, and mgr is the private back-end of your website (i.e., the manager that you're logged in). | web | +| Minimum Role | This specifies what user roles this rule will apply to. If we want all users in this user group, select "Member - 9999". This is where some of that fine control comes in that we talked about earlier. | Member - 9999 | +| Access Policy | This specifies what permissions we're giving to the users. Different policies will allow user groups to do different things. | Administrator | -We now have users in a user group, resources in a resource group, and that user group can view the context. We're so close! +Make one rule with "web", "Member - 9999", and "Load, List and View". To let users view the manager, add a second rule for the mgr context: "mgr", "Member - 9999", and "Administrator". Those users get admin access. To limit their permissions, choose "Content Editor" or "Developer" for their access policy. You can also make your own policy on the **Access Policies** tab of **Access Control Lists**. ### 5. Flush Permissions -Before you can see a change, you need to reset / flush what your individual users can see and do. Go to Security > Flush Permissions. To test this in the front end, you must use a different browser. 90% of your grief will come from not testing in a different browser or flushing your permissions, so don't be lazy and open that second browser up. Congratulations, you now have members-only pages! - -In some cases you may need to clear the site cache, specifically for the mgr (manager) context as elements and resources may cache their permissions. - -## Step-by-step explanation (pre-2.2.2) - -If you're not quite as savvy, or would rather also know what happens when you set a certain permission or make an access entry, you might find this section interesting. As of 2.2.2, MODX ships with an Access Wizard and you might wish to start with that. - -### 1. Create a Resource Group - -A [Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") is a collection of resources which you can link to user groups and access list entries. When you have created a resource group, you can easily classify pages to be only visible for certain user groups, or roles within user groups. - -To create a resource group, navigate to Security -> Resource Groups and click on the Create Resource Group button. In the popup you are prompted to enter a name for the resource group. In the tutorial we expect you named it "Protected". - -### 2. Link your member-only resource to the Resource Group - -Now that you have a resource group, you should add resources to it. There are two ways to achieve this. - -First, go to Security -> Resource Groups and drag Resources from the right tree into the left groups ("Protected"). Or edit the Resource and check **Access** on the Resource Groups tab. - -### 3. Create a User Group +Before you can see a change, flush what your users can see and do. Go to **Flush Your Permissions**. To test the front end, use a different browser. Most of the trouble comes from testing in the same browser or skipping the flush. -You have a resource group with resource applied to them, now you'll need to decide who will be able to view the resources. For this, we'll make a new user group. - -To do this, go to Security -> Access Controls. On the (default) User Groups tab, click on the New User Group button. Choose a name for the group, and submit the form. - -### 4. Add Resource Group access - -Move on to the "Resource Group Access" tab. This tab defines the resource groups your user group has access to. Three out of four fields are similar to the Context Access groups, namely the Context, Minimum Role and Access Policy. A new one is Resource Group which, as you probably guessed, defines the resource group the user group can access. - -The settings: - -- Resource Group: whatever you named it, for example "Protected" -- Context: web -- Minimum role: Member (9999) -- Access Policy: Resource - -It is important to realize that as soon as you have protected a resource by (1) assigning it to one or more resource groups and (2) linking the resource group to a user group using an access control, those pages will no longer show up for users that are not linked to the resource group. The default behavior in that case is displaying the 404-error page. If you would rather return the 401-error, you will need to give the anonymous user group "load" permission for the resource group. More about this in a later tutorial. At this moment in the tutorial, your page will not be visible as you have not yet added it to a user group. - -### 5. Add users to the user group - -Now add some users to the user group. You can do this by editing the user, or by going back to the Users tab and adding them from there. It will ask for the User Group, as well as the Role. As we assumed the Member role with an authority of 9999, you can simply use that one. - -When using a websignup snippet, make sure it automatically puts them in the right user group. - -### 6. Flush permissions - -Now that all settings are done, you will need to flush permissions (Security -> Flush Permissions) before you will see an effect. Also make sure that, if you go to test it front-end, you use a different browser all together. Don't use a different tab or browser window, as it will still use your Manager login to check for permissions. - -Please note that in some cases it is also necessary to clear the site cache, specifically for the mgr (manager) context, as elements and resources may cache their permissions. +In some cases you may need to clear the site cache, specifically for the mgr (manager) context, because elements and resources may cache their permissions. ## Still can't get it to work? -Make sure you followed everything step by step and that you flushed permissions properly. If everything seems to be alright, check again and then go to the Forums to ask for help. If you think the tutorial is misleading or inaccurate, please visit the forum topic (linked below) and post about what is incorrect so it can be fixed. +Check the steps and the flush. If the pages still fail, ask on the [MODX Community](https://community.modx.com). -## See Also - -Bob's permissions guide: +Two further readings help with the permissions themselves. [Bob's permissions guide](http://bobsguides.com/revolution-permissions.html) covers the model in depth. The [Login.Basic Setup](/extras/login/login.tutorials/basic-setup "Login.Basic Setup") tutorial shows a basic "Members Only" area built with the Login Snippet. -Forum topic discussing this tutorial: - -Using the Login Snippet to set up a basic "Members Only" area: [Login.Basic Setup](/extras/login/login.tutorials/basic-setup "Login.Basic Setup") +## See Also -Security: [Security](building-sites/client-proofing/security "Security") +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md b/en/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md index ae16525a3..33e94548d 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md +++ b/en/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md @@ -1,33 +1,59 @@ --- title: "More on the Anonymous User Group" +description: "Who the anonymous user of MODX is, and how to give the visitor a different access than the default one." _old_id: "1352" _old_uri: "2.x/administering-your-site/security/security-tutorials/more-on-the-anonymous-user-group" --- ## Who's Anonymous? -Anyone who visits the site and is not logged in belongs to the Anonymous [User Group](building-sites/client-proofing/security/user-groups "User Groups"). +Anyone who visits the site and is not logged in is the anonymous user. -You can edit the User Group by navigating to the top menu item Security » Access Controls, User Groups tab. Then right-click on the Anonymous User Group's name and select "Update User Group". ![](access+controls.png) +**The anonymous user is not a User Group** +There is no group named Anonymous. In the group tree the visitor shows up as `(anonymous)`. You can edit that entry like any other group. What you change is the anonymous user's access. + +You reach it from the lock icon → **Access Control Lists**, the tab **User Groups & Users**. Right-click `(anonymous)` and select **Edit User Group**. ![](access+controls.png) ## What Can Anonymous Users Do? -By default, Anonymous Users are granted Load Only permissions in every [Context](building-sites/contexts "Contexts") except the "mgr" Context. Without Load Only permissions, requests to the Context would result in a 404 Page Not Found response. +By default, the anonymous user is granted Load Only in every [Context](building-sites/contexts "Contexts") except the "mgr" Context. Without Load Only, a request to the Context returns 404 Page Not Found. ![](user+group_+anonymous.png) -Load Only permissions doesn't necessarily mean they can View the Resource (see below). +Load Only does not necessarily mean they can View the Resource. -For example, if you create a [Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") and grant access permissions to a specific User Group, the Anonymous User Group won't be able to access that Resource Group at all. This is the basis of [Creating Member Only Pages](administering-your-site/security/security-tutorials/making-member-only-pages "Making Member-Only Pages"). +If you create a [Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") and grant it to a specific User Group, the anonymous user cannot access it. That is the basis of [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages "Making Member-Only Pages"). ### 401 vs 404 Response on Protected Pages -When you create protected Resource Groups, the Anonymous User Group won't have Load permissions on it by default - they will get a 404 Page Not Found response. If you want them to see a 401 Unauthorized response instead, you have to grant the Anonymous User Group access to the Resource Group with Load Only permissions. +On a protected Resource Group, the anonymous user has no Load permission by default and gets 404 Page Not Found. To return 401 Unauthorized instead, grant that user access to the Resource Group with the Load Only policy. -You can do this in the Resource Group Access tab of the Anonymous User Group editing page. +Do this on the Resource Group Access tab of the anonymous user's editing page. ![](screen+shot+2012-10-19+at+11.43.46+pm.png) -Click on "Add Resource Group", select the protected Resource Group in the dropdown, select the Context in which you want to grant access (don't select the "mgr" context) and choose Load Only as the Access Policy. Click "Save" and you're done. - -They still will not be able to view the Resources in that protected Resource Group - they will only be able to "Load" it, and get a 401 response. You can specify a Resource ID to serve as a custom Unauthorized page by using the [Unauthorized Page System Setting](building-sites/settings/unauthorized_page "unauthorized_page"). +Click "Add Resource Group", select the protected Resource Group, and select the Context (don't select the "mgr" context). Choose Load Only as the Access Policy and click "Save". + +They still cannot view the Resources in that Resource Group. They can only Load it, and the response is 401. Set a Resource ID as the Unauthorized page with the [Unauthorized Page](building-sites/settings/unauthorized_page "unauthorized_page") system setting. + +## See Also + +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md b/en/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md index e22f9dc97..959cf50fe 100644 --- a/en/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md +++ b/en/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md @@ -1,14 +1,11 @@ --- title: "Restricting an Element from Users" +description: "Hide an element of MODX from the users who may not edit it, with the access to its category." _old_id: "486" _old_uri: "2.x/administering-your-site/security/security-tutorials/restricting-an-element-from-users" --- -## Introduction - -This tutorial teaches you how to restrict any Element (such as a Template, Snippet, etc) from view in the MODX manager. It uses Element Category ACLs to accomplish the task, which allow you to protect any Elements in Categories from view. Users in the Editors User Group will be able to see the elements, but they will be hidden from users outside the group. - -### Brief Summary +## Brief Summary 1. Create a Category or use an existing one 2. Place the Element you want to protect into your Category @@ -21,7 +18,7 @@ This tutorial teaches you how to restrict any Element (such as a Template, Snipp ### 1. Create a Category -Click the Elements tab on the left-hand tree, and click the Category icon in the toolbar, or right-click "Categories" at the bottom, then click "New Category". Create and save a new category. Alternatively, you can use an already-existing Category for this tutorial. +Click the Elements tab in the left tree, then the Category icon in the toolbar. Or right-click "Categories" at the bottom and click "New Category". Save the category. An existing category works too. ### 2. Place the Element into the Category @@ -29,19 +26,17 @@ Edit the Element and set its Category to be the new Category created in step 1. ### 3. Create a User Group -Go to Security -> Access Controls in the top menu, and find the "User Groups" tab. Then either create a new User Group or select a prior one. From there, right-click on the User Group and select "Update User Group". - -For Revolution 2.3.x, the Access Control Lists menu item is found in the Admin menu (the gear icon). +Go to the lock icon → **Access Control Lists** and open the **User Groups & Users** tab. Create a user group or select an existing one. Right-click it and select **Edit User Group**. -If using the Access Wizard form, make sure the group is given "mgr" access in the Context field, and specify the Category in the Element Categories field. You can also put a list of users to be added to this group in the Users field. Right-click on the new User Group to update it if not using the Wizard. +On the Access Wizard form, give the group "mgr" in the Context field and set the Category in the Element Categories field. The Users field can list users to add to this group. If you are not using the Wizard, right-click the new User Group and update it. ### 4. Add the Users to the User Group -With the new User Group open for updating, find the Users tab, and then add any users you want to see the Element into this User Group. Make sure to give them a Role of **at least** Member. Alternately, you can add individual users to the new User Group from the User's editing page in the Access Permission tab. +With the new User Group open, open the Users tab and add the users who should see the Element. Give them a role of **at least** Member. Or add a user from that user's editing page, on the Access Permission tab. ### 5. Add the Element Category ACL -Find the "Element Category Access" tab on this screen. For Revolution 2.3.x, this will be in the sidebar of the User Group's Permissions tab. +Open the "Element Category Access" tab. It sits in the group panel, next to the other access tabs. Click "Add Category" on the button above the grid. Select: @@ -54,33 +49,32 @@ Click "Add Category" on the button above the grid. Select: ### 6. Flush Permissions -On the top menu, find "Security -> Flush Permissions" and click it. For Revolution 2.3.x this is Manage -> Logout All Users. +Open the lock icon → **Flush Your Permissions**, then **Logout All Users**. -This force everyone to log in again, and your Element Category will now be protected from users outside the Editors User Group. +This forces everyone to log in again. The Element Category is then protected from users outside the Editors User Group. ## Hiding Specific Elements from Certain Users Sometimes, you want to hide elements from all users who are not in the Administrator group. To do that, put the elements in a category as we did above, but connect it to the Administrator user group: -- Go to the Administrator User Group edit page (Security -> Access Controls -> User Groups -> right click on "Administrator" and select Update User Group) For Revolution 2.3.x this is Access Control Lists in the Admin menu (the gear icon). +- Go to the Administrator User Group edit page: the lock icon in the user menu → **Access Control Lists** → the tab **User Groups & Users** -> right click "Administrator" and pick **Edit User Group** - Find the Element Category Access tab - Add the following ACL entry, by clicking on "Add Category": - Category: your Category you made/selected earlier - - Minimum Role: admin Super User + - Minimum Role: Super User - Access Policy: Element - Context: mgr - Click on the "Save" button in the dialog - Click on the "Save" button at the upper right - -- click Security -> Flush All Sessions in the top menu. For Revolution 2.3.x this is Manage -> Logout All Users. +- Click the lock icon in the user menu → **Logout All Users**. Now, only the admin Super User can see the elements. ## Special Case for Templates -Lets say you restricted a Template with the method above. But you also want another User Group, which doesn't have access to the Template, the ability to edit (but not create!) Resources with that Template, and see the Template's TVs. Currently, the 2nd User Group (Let's call them Editors) would be able to see the Resource, and the ID of the Template will show in the Template combobox, but they wont be able to see the TVs. We need to add another ACL to the Editors User Group to get them to load the Template and its associated TVs. +You restricted a Template with the method above. Another User Group should edit Resources that use that Template, but not create them. It should see the Template's TVs, though it has no access to the Template. That group (call them Editors) would see the Resource. The Template combobox would show the Template ID, and they would not see the TVs. Add another ACL on that group so it loads the Template and its TVs. -- Go to the Editors User Group edit page (Security -> Access Controls -> User Groups -> right click on "Editors" and select Update User Group) +- Go to the Editors User Group edit page: the lock icon in the user menu → **Access Control Lists** → the tab **User Groups & Users** -> right click "Editors" and pick **Edit User Group** - Find the Element Category Access tab - Add the following ACL entry, by clicking on "Add Category": - Category: your Category you made/selected earlier @@ -89,15 +83,28 @@ Lets say you restricted a Template with the method above. But you also want anot - Context: mgr - Click on the "Save" button in the dialog - Click on the "Save" button at the upper right +- Have the users in the Editors User Group logout and log back in, or alternatively click **Logout All Users** in the top menu -- Have the users in the Editors User Group logout and log back in, or alternatively click Security -> Flush Sessions in the top menu - -Done! Your Editors will now be able to see and edit TVs for the Template in the protected Category and they will be hidden from users who are not in the Editors User Group. +Editors will now see and edit the TVs for the Template in the protected Category. The Template stays hidden from users who are not in the Editors User Group. ## See Also -1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/troubleshooting-security/index.md b/en/building-sites/client-proofing/security/troubleshooting-security/index.md index 6b48cc706..8b2b62b1a 100644 --- a/en/building-sites/client-proofing/security/troubleshooting-security/index.md +++ b/en/building-sites/client-proofing/security/troubleshooting-security/index.md @@ -1,5 +1,6 @@ --- title: "Troubleshooting Security" +description: "What to check when the access of MODX does not behave as it should." _old_id: "490" _old_uri: "2.x/administering-your-site/security/troubleshooting-security" --- diff --git a/en/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md b/en/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md index 9ea0da3b5..47c671e45 100644 --- a/en/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md +++ b/en/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md @@ -1,112 +1,76 @@ --- title: "Resetting a User Password Manually" +description: "Reset the password of a user of MODX when the link for a forgotten password does not reach them: in the database or through the API." _old_id: "484" _old_uri: "2.x/administering-your-site/security/troubleshooting-security/resetting-a-user-password-manually" --- ## Resetting a User Password via Database Manipulation -It is not uncommon for a User account to become inaccessible because of a lost/forgotten password. In many cases, this can easily be resolved by having the user use the Forgot Password link on the login form. But in some cases you may need to manually reset the password directly in the database. You will need access to the database containing the MODX tables in order to this, either via PHPMyAdmin or another database client that allows you to edit or UPDATE database records. +Have the user try the Forgot Password link on the login form. If the account is still unreachable, reset the password in the database. -### Resetting Password in MODX 2.1+ +**The shipped hasher cannot be calculated in the database** +MODX 3 stores the password with `MODX\Revolution\Hashing\modNative`. A database statement cannot produce that hash. -In MODX 2.1+, users are created by default with the a hashing algorithm called PBKDF2. Databases like MySQL or SQL Server generally do not have functions for calculating these hashes, and as a result, in order to manually reset the password in the database, you will also need to change the hash\_class specified for the user from hashing.modPBKDF2 to hashing.modMD5. Then you can use the native MD5() function to set the value of the password field appropriately. Here is an example MySQL UPDATE statement: +Set the user's `hash_class` to `MODX\Revolution\Hashing\modMD5` and write the password as an MD5 hash. The database has an `MD5()` function for that. Run this statement. The table name carries your installation's prefix: -``` php -UPDATE modx_users SET hash_class = 'hashing.modMD5', password = MD5('the-new-password') WHERE username = 'theusername'; +``` sql +UPDATE modx_users SET hash_class = 'MODX\\Revolution\\Hashing\\modMD5', password = MD5('the-new-password') WHERE username = 'theusername'; ``` -If you want to then have the user password automatically converted back to PBKDF2, you can install the [pbkdf2Convert Plugin](https://modx.com/extras/package/pbkdf2convert) available from Package Management. - -### Resetting Password in MODX 2.0.x - -In MODX 2.0.x, you can simply reset the password field with a valid MD5 hash value directly in the database table. Here is an example MySQL UPDATE statement that can reset a user's password by username: - -``` php -UPDATE modx_users SET password = MD5('the-new-password') WHERE username = 'theusername'; -``` +The user can then log in with it. The next password change keeps hashing with `MODX\Revolution\Hashing\modMD5`. To return to the shipped hasher, set `hash_class` to `MODX\Revolution\Hashing\modNative` and then save a new password in the manager. The name of the class has to be given with its namespace. The older name without it works only through a deprecated alias that prints a warning. ## Resetting a Password via the API -You can also reset the password (or manipulate any part of the MODX application) by using the API. Below is a sample script to update the password and email address of a given user. It also ensures this user is in the Administrator User Group. +This script sets a new password for an existing user. The password is hashed with the class already stored in `hash_class`. ``` php initialize('mgr'); -$query = $modx->newQuery('modUser'); -$query->where( array('username'=>$username) ); -$user = $modx->getObjectGraph('modUser', '{ "Profile":{}, "UserGroupMembers":{} }', $query); -// print_r($user); exit; +$user = $modx->getObject(\MODX\Revolution\modUser::class, ['username' => $username]); if (!$user) { - die("ERROR: No user with username $username"); + die('ERROR: No user with that username.'); } -$user->set('username',$username); -$user->set('active',1); $user->set('password', $password); -$user->Profile->set('email', $email); -$user->Profile->set('blocked', 0); -$user->Profile->set('blockeduntil', 0); -$user->Profile->set('blockedafter', 0); - -// Verify the user is a member of specified User Group -$is_member = false; -if (!empty($user->UserGroupMembers)) { - foreach ($user->UserGroupMembers as $UserGroupMembers) { - if ($UserGroupMembers->get('user_group') == $user_group) { - $is_member = true; - break; - } - } -} -// Add the User to the User Group if he is not a member -if (!$is_member) { - // Verify the user group exists - $UserGroup = $modx->getObject('modUserGroup', $user_group); - if (!$UserGroup) { - die ("ERROR: User Group $user_group does not exist."); - } - - $Member = $modx->newObject('modUserGroupMember'); - $Member->set('user_group', $user_group); - $Member->set('member', $user->get('id')); - // Super User = role 2 - $Member->set('role', 2); - $Member->set('rank', 0); - $user->addOne($Member,'UserGroupMembers'); -} - -/* save user */ if (!$user->save()) { - die('ERROR: Could not save user.'); + die('ERROR: Could not save the user.'); } -print "SUCCESS: User $username updated."; - -?> +echo 'SUCCESS: password updated.'; ``` -You can put this script anywhere on your server so long as you update the path to the primary **index.php** file. You can execute the script by hitting it in a browser or via the command line. - -**Warning** -Be extremely careful when using a script like this! If possible, do NOT put it inside your document root – instead put it outside of your document root and execute the script via the command line. \ No newline at end of file +Put the script anywhere on the server, and update the path to the main **index.php**. Run it in a browser or from the command line. + +> [!WARNING] +> Be extremely careful with a script like this. If possible, do not put it inside your document root. Put it outside the document root and run it from the command line. + +## See Also + +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) + 1. [Permissions](building-sites/client-proofing/security/policies/permissions) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACLs](building-sites/client-proofing/security/policies/acls) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) + 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/user-groups.md b/en/building-sites/client-proofing/security/user-groups.md index c5217b099..0f8f77db1 100644 --- a/en/building-sites/client-proofing/security/user-groups.md +++ b/en/building-sites/client-proofing/security/user-groups.md @@ -1,5 +1,6 @@ --- title: "User Groups" +description: "The user groups of MODX: the permissions they carry, the five kinds of access they define, and the roles inside them." _old_id: "328" _old_uri: "2.x/administering-your-site/security/user-groups" --- @@ -8,24 +9,23 @@ _old_uri: "2.x/administering-your-site/security/user-groups" User Groups are used by MODX to define permissions. Unlike some CMS's, in MODX a User can belong to _multiple_ User Groups. -## Usage +Permissions in MODX are granted to _User Groups_, not to individual users. A User must belong to at least one User Group to have any permissions. What a User can or cannot do depends on which User Groups the User belongs to. In other CMS's this concept is sometimes referred to as a "role". -Permissions in MODX are granted to _User Groups_, not to individual users, so a User must belong to at least one User Group in order to have any permissions. In other words, what a User can or cannot do depends on which User Groups the User belongs to. In other CMS's this concept is sometimes referred to as a "role". +To edit the permissions of a User Group, go to the lock icon in the user menu → **Access Control Lists**. Right-click an existing User Group to update it, or create a new User Group. -To edit a User Group's permissions, you need to go to Admin (the little gear icon) -> Access Control Lists, then right-click an existing User Group to update it, or create a new User Group. +A User Group can define access permissions to five areas: -A User Group can define access permissions to four areas: - -- **Context Access** -- this is where you would define access to the manager or to a front-end login portal. -- **Resource Group Access** -- this is where you would define access to a Resource Group -- **Element Category Access** -- this is where you could limit access to only certain Chunks or to only certain fields within a resource. -- **Media Source Access** -- this is where you could limit access to certain folders on the filesystem or S3 buckets. +- **Context Access** -- access to the manager or to a front-end login portal. +- **Resource Group Access** -- access to a Resource Group. +- **Element Category Access** -- access to only certain Chunks or to only certain fields within a resource. +- **Media Source Access** -- access to certain folders on the filesystem or S3 buckets. +- **Namespace Access** -- access to the elements of a namespace. ## Managing Members -To add or remove Users to User Groups you can edit the User Groups when you edit a single User (Manage -> Users) then right-click the User you want to edit and view the "Access Permissions" tab. +To add or remove Users from a User Group, edit the User Group when you edit a single User. Go to the lock icon in the user menu → **Users**, right-click the User you want to edit, and view the "Access Permissions" tab. -Another way to control this is by going to Admin -> Access Control Lists. From there you will see a tree of User Groups and their respective Users. You can assign a User to a User Group by right-clicking on the User Group and either: +Another way is to go to the lock icon in the user menu → **Access Control Lists**. From there you see a tree of User Groups and their respective Users. Assign a User to a User Group by right-clicking on the User Group and either: - Adding the User via the context menu item - Editing the User Group and adding a User on the grid there @@ -46,13 +46,17 @@ The Settings tab on a User Group defines [Setting](building-sites/settings) valu Users can have specific Roles within a User Group, should you choose. They can also exist in the User Group without a Role. Roles allow you to fine-tune your permissions more than in previous MODX versions. -Say you want to only allow Supervisors in the "HR Department" User Group access to some Resources; no problem. Just create a Role called "Supervisor", set its authority to some number below 9999 (let's say 3), and then add in the Users to the User Group "HR Department" (via the User Group editing screen), setting any would-be supervisors to the Supervisor Role. +Say you want to only allow Supervisors in the "HR Department" User Group access to some Resources; no problem. Just create a Role called "Supervisor" and set its authority to some number below 9999 (let's say 3). Then add the Users to the User Group "HR Department" (via the User Group editing screen), setting any would-be supervisors to the Supervisor Role. Then, you'll just add a Resource Policy (the packaged-in-with-modx one will do fine) to the Resource Group you want to restrict access to. It will look something like this: ![](ug-rg-grid1.png) -And you've got a role-based access permission! This specific ACL will limit all Resources (aka Documents) in the web context and in the resource group "TestResourceGroup4" to only Users in the "HR Department" User Group with at least a Role of Supervisor. Roles with lower authority numbers would also inherit access - say you had a Coordinator Role with an authority of 2; Users in this User Group would have access to this ACL as well. +And you've got a role-based access permission! This specific ACL limits all Resources in the web context and in the group "TestResourceGroup4" to Users of the "HR Department" User Group with at least a Role of Supervisor. Roles with lower authority numbers inherit the access as well. Say you had a Coordinator Role with an authority of 2: Users in this User Group would have access to this ACL too. + +### The Permissions of the Page + +The page of the groups needs the permission `usergroup_view` to see the list, `usergroup_new` and `usergroup_save` to create a group, `usergroup_edit` to change one, and `usergroup_delete` to delete one. To manage the members, `usergroup_user_list` shows them and `usergroup_user_edit` adds and removes them. ### Assigning User Groups and Roles via the MODX API @@ -70,22 +74,22 @@ if( $user ){ ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/en/building-sites/client-proofing/security/users.md b/en/building-sites/client-proofing/security/users.md index 1f1a2c93b..4f58e9355 100644 --- a/en/building-sites/client-proofing/security/users.md +++ b/en/building-sites/client-proofing/security/users.md @@ -1,104 +1,138 @@ --- title: "Users" +description: "The users of MODX: their fields, the flag of the superuser, the settings of a user, and the properties of the user on the front-end." _old_id: "329" _old_uri: "2.x/administering-your-site/security/users" --- ## What is a User? -A User is simply a representation of a login in MODX Revolution. +A User is a login in MODX. -Users can also be assigned to User Groups, which can have [ACLs](building-sites/client-proofing/security/policies/acls "ACLs") attached to them to provide Access Controls. +Users are assigned to User Groups, which carry [ACLs](building-sites/client-proofing/security/policies/acls "ACLs") that provide the access. + +## The Superuser + +The field `sudo` makes a user a superuser. Policy checks do not run for that user. The user sees everything, whatever the ACLs say. + +Only a user with the permission `set_sudo` can give it away. The administrator of a fresh installation gets it. ## User Settings -User Settings in MODX Revolution will automatically override any System or Context settings with the same key for that user. They can also be completely unique settings as well. The order of inheritance for Settings is: +A user setting overrides a user group setting of the same key. A user group setting overrides a context setting. A context setting overrides the system setting. The order is: -`System Settings -> Context Settings -> User Settings` +`System setting → Context setting → User group setting → User setting` -To edit the user settings, navigate to **Security -> Manage Users -> Update User (_right-click_) -> Settings (_tab_)** +To edit the settings of a user, open the lock icon → **Users**, right-click the user and choose **Edit**, then open the **Settings** tab. -You can change user-specific settings only _after_ you've created the user. The "Settings" tab is not visible when you first create the user. +You can change those settings only after the user exists. The Settings tab is not on the create form, and only a sudo user sees it. Log in as sudo to edit the settings of a user. ## Users in the Front-End -When a user is logged into the frontend of your site, their username and ID can be accessed by the following [Properties](building-sites/properties-and-property-sets "Properties and Property Sets"): +When a user is logged into the frontend of your site, their username and ID are available as [Properties](building-sites/properties-and-property-sets "Properties and Property Sets"): ``` php [[+modx.user.id]] - Prints the ID [[+modx.user.username]] - Prints the username ``` -If a user is not logged in, ID will be blank, and Username will be "(anonymous)". +If a user is not logged in, the ID is 0 and the username is `anonymous`. -As of MODX 2.4.0, the default Username can be set in the Systems Settings with the **default\_username** setting. +The default Username is set with the `default_username` setting. **Remember** -Keep in mind that confusing caveat: just because you have logged into the _manager_ does not mean that you are logged into the _web_ front-end. The user-specific settings and the [getOption](extending-modx/xpdo/class-reference/xpdoobject/configuration-accessors/getoption "getOption") API method obeys this same rule, so if you're not logged in, then the **System Settings -> Context Settings -> User Settings** cannot fully apply. +Logging into the _manager_ does not log you into the _web_ front end. If you are not logged in on the site, the chain **system setting → context setting → user group setting → user setting** cannot fully apply. [Code that reads a setting](extending-modx/xpdo/class-reference/xpdoobject/configuration-accessors/getoption "getOption") follows the same split. -## User Field +## The Fields of a User Users contain the following fields: -| Name | Description | -| ------------ | ------------------------------------------------------------------ | -| id | The ID of the user. | -| username | The username of the user. | -| password | The user's encrypted password. | -| active | Either 1 or 0. If not active, the user will not be able to log in. | -| remote\_key | A remote user Key used by remote authentication apps. | -| remote\_data | A JSON array of data used by remote authentication apps. | +| Name | Description | +| -------------- | ------------------------------------------------------------------------------------------------------------- | +| id | The ID of the user. | +| username | The username of the user. | +| password | The user's encrypted password. | +| cachepwd | The cached password of the user. | +| class\_key | The class of the user. A user of a derived class inherits the behaviour of that class. | +| active | Either 1 or 0. If not active, the user will not be able to log in. | +| remote\_key | A remote user Key used by remote authentication apps. | +| remote\_data | A JSON array of data used by remote authentication apps. | +| hash\_class | The class that hashes the password of the user. The default of MODX 3 is `MODX\Revolution\Hashing\modNative`. | +| salt | The salt stored on the user. The shipped hasher `modNative` does not use this column. | +| primary\_group | The group that the user gets the dashboard and the access of its primary group from. | +| session\_stale | Whether the session of the user is stale. | +| sudo | Whether the user is a superuser. See [The Superuser](#the-superuser). | +| createdon | The date the user was created. | Users also have a Profile attached to them. It contains the following fields: -| Name | Description | -| ---------------- | ---------------------------------------------------------------------------------- | -| internalKey | The ID of the user. | -| fullname | The full name of the user. | -| email | The email of the user. | -| phone | The phone number. | -| mobilephone | The cellphone number. | -| fax | The fax number. | -| blocked | Either 1 or 0. If blocked is set to true, the user will not be able to log in. | -| blockeduntil | A timestamp that, when set, will prevent the user from logging in until this date. | -| blockedafter | A timestamp that, when set, will prevent the user from logging in after this date. | -| logincount | The number of logins for this user. | -| lastlogin | The last time the user logged in. | -| thislogin | The time the user logged in in their current session. | -| failedlogincount | The number of times the user has failed to log in since last logging in. | -| sessionid | The User's session ID that maps to the session table. | -| dob | The date of birth. | -| gender | 0 for neither, 1 for male and 2 for female. | -| address | The physical address. | -| country | The country of the user. | -| city | The city of the user. | -| zip | The zip or postal code for the user. | -| state | The physical state or province of the user. | -| photo | An optional field for a photo. Not used in the UI. | -| comment | An optional comment field for comments on the User. | -| website | The website of the user. | -| extended | A JSON array that can be used to store extra fields for the User. | +| Name | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| internalKey | The ID of the user. | +| fullname | The full name of the user. | +| email | The email of the user. | +| phone | The phone number. | +| mobilephone | The cellphone number. | +| fax | The fax number. | +| blocked | Either 1 or 0. If blocked is set to true, the user will not be able to log in. | +| blockeduntil | A timestamp that, when set, will prevent the user from logging in until this date. | +| blockedafter | A timestamp that, when set, will prevent the user from logging in after this date. | +| logincount | The number of logins for this user. | +| lastlogin | The last time the user logged in. | +| thislogin | The time the user logged in in their current session. | +| failedlogincount | The number of times the user has failed to log in since last logging in. | +| sessionid | The User's session ID that maps to the session table. Deprecated, to be removed in 3.2. | +| dob | The date of birth. | +| gender | 0 for neither, 1 for male and 2 for female. | +| address | The physical address. | +| country | The country of the user. | +| city | The city of the user. | +| zip | The zip or postal code for the user. | +| state | The physical state or province of the user. | +| photo | The path to the picture of the user. It is shown in the header of the manager and is loaded through the Media Source of the setting `photo_profile_source`. If the user has no picture and the setting `enable_gravatar` is on, Gravatar is used. | +| comment | An optional comment field for comments on the User. | +| website | The website of the user. | +| extended | A JSON array that can be used to store extra fields for the User. | + +## The Settings of the Accounts + +| Setting | What it does | +| ------------------------------- | --------------------------------------------------------------------- | +| `passwordless_activated` | Turns the login by a magic link on. Off by default. | +| `passwordless_expiration` | The lifetime of the magic link, in seconds. 3600 by default. | +| `password_min_length` | The minimum length of a password. 12 by default. | +| `password_generated_length` | The length of a password that MODX generates. 16 by default. | +| `allow_multiple_emails` | Whether a user may have several addresses. | +| `clean_phone_number` | Whether the phone number is cleaned before it is saved. | +| `default_username` | The name of the user that is not logged in. `(anonymous)` by default. | +| `enable_gravatar` | Whether Gravatar is used when the user has no picture. | +| `photo_profile_source` | The Media Source the picture of the user is loaded from. | +| `unauthorized_page` | The page an unauthorized user is sent to. | +| `access_context_enabled` | Whether the access to a context is checked at all. | +| `access_resource_group_enabled` | Whether the access to a resource group is checked at all. | ## Grabbing the User via the API -The current user can be retrieved in the API via the $modx->user reference. For example, this snippet outputs the username of the user: +The current user is available in the API as `$modx->user`. This snippet outputs the username: ``` php return $modx->user->get('username'); ``` -Note that to grab Profile fields, you'll need to first get the modUserProfile object via the Profile alias. For example, this snippet grabs the email of the user and returns it: +To read Profile fields, get the `modUserProfile` object through the Profile alias first. This snippet returns the user's email: ``` php $profile = $modx->user->getOne('Profile'); return $profile ? $profile->get('email') : ''; ``` -If the User is not logged in, $modx->user will still be available as an object, but will return 0 as the ID and (Anonymous) as the username. +If the user is not logged in, `$modx->user` is still available as an object. It returns 0 as the ID and `anonymous` as the username. + +To write your own User class, see [Extending modUser](extending-modx/custom-users "Extending modUser"). ### Using Extended Fields -Values in the extended field return as an array. They can be manipulated like so: +Values in the `extended` field return as an array: ``` php /* get the extended field named "color": */ @@ -113,23 +147,22 @@ $profile->save(); ## See Also -1. [Users](building-sites/client-proofing/security/users) -2. [User Groups](building-sites/client-proofing/security/user-groups) -3. [Resource Groups](building-sites/client-proofing/security/resource-groups) -4. [Roles](building-sites/client-proofing/security/roles) -5. [Policies](building-sites/client-proofing/security/policies) +1. [Security (ACLs)](building-sites/client-proofing/security) +2. [Users](building-sites/client-proofing/security/users) +3. [User Groups](building-sites/client-proofing/security/user-groups) +4. [Resource Groups](building-sites/client-proofing/security/resource-groups) +5. [Roles](building-sites/client-proofing/security/roles) +6. [Policies](building-sites/client-proofing/security/policies) 1. [Permissions](building-sites/client-proofing/security/policies/permissions) - 1. [Permissions - Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Permissions - Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Administrator Policy](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Resource Policy](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACLs](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) + 3. [Policy Templates](building-sites/client-proofing/security/policies/policytemplates) +7. [Security Tutorials](building-sites/client-proofing/security/security-tutorials) 1. [Giving a User Manager Access](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Making Member-Only Pages](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) 3. [Creating a Second Super Admin User](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) 4. [Restricting an Element from Users](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) 5. [More on the Anonymous User Group](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Hardening MODX Revolution](getting-started/maintenance/securing-modx) 8. [Troubleshooting Security](building-sites/client-proofing/security/troubleshooting-security) 1. [Resetting a User Password Manually](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) -9. [Extending modUser](extending-modx/custom-users "Extending modUser") diff --git a/ru/building-sites/client-proofing/custom-manager-themes.md b/ru/building-sites/client-proofing/custom-manager-themes.md index 9a23e2897..3f450ec2f 100644 --- a/ru/building-sites/client-proofing/custom-manager-themes.md +++ b/ru/building-sites/client-proofing/custom-manager-themes.md @@ -1,34 +1,61 @@ --- title: "Пользовательские темы системы управления" translation: "building-sites/client-proofing/custom-manager-themes" +description: "Переопределить файлы менеджера MODX своей темой: как выбирается тема, что она обязана содержать и как переопределить один файл или контроллер." --- -**Важно**: Когда вы используете пользовательские темы или шаблоны системы управления, вам необходимо убедиться, что после обновления MODX все работает должным образом. Пользовательские шаблоны системы управления нередко конфликтуют с изменениями в ядре. +> [!IMPORTANT] +> Проверяйте свою тему менеджера после каждого обновления MODX. Тема может конфликтовать с изменениями нового выпуска, а файлы, которые выпуск добавляет, тема никогда не подхватывает. -Настройка системы управления и её шаблонов. Например, если вы хотите настроить форму входа системы управления. +## Как устроена тема -Система управления MODX использует шаблон так же, как обычные страницы MODX. Файлы шаблонов системы управления находятся в директории **manager/templates/default**. Вы можете изменить системную настройку **manager_theme**, чтобы они указывали на новый каталог. +Менеджер построен на шаблонах Smarty. Файлы стандартной темы лежат в `manager/templates/default`. Системная настройка `manager_theme` хранит имя каталога внутри `manager/templates/`. Менеджер сначала читает файлы этой темы, а недостающие берёт из `default`. -Способ настройки подобен расширению класса PHP: вы можете переопределить любой отдельный файл, имитируя структуру каталогов и меняя каталог в **manager_theme**. +В MODX 3 поставляется только тема `default`. Остальные приходят со сборкой, с дополнением или делаются вами. -Для версии 2.1 и более ранних необходимо скопировать весь каталог контроллеров и шаблонов для вашей темы. Для версии 2.2 и более поздних можно копировать отдельные файлы. +Тема покрывает не только страницы менеджера. Из неё же берутся шаблоны виджетов панелей и TV, а также контроллеры ресурсов. -Например, чтобы настроить только шаблон входа в систему управления, вы можете скопировать следующий файл в новый каталог: +## Переопределение одного файла ->manager/templates/default/security/login.tpl +Чтобы оформить только страницу входа, скопируйте файл: -Скопируйте этот файл в новый каталог, например, в такой: +`manager/templates/default/security/login.tpl` → `manager/templates/my-brand/security/login.tpl` ->manager/templates/custom/security/login.tpl +Затем задайте в `manager_theme` значение `my-brand`. Файл из `my-brand` заменит файл из `default`. -Затем обновите системную настройку **manager_theme**, чтобы она указывала на вновь созданный **пользовательский** каталог, и версия файла из **пользовательского** каталога заменит версию файла из каталога по умолчанию. +**Создайте каталог до того, как выберете тему** +Настройка это выпадающий список каталогов `manager/templates/`. Значение нельзя вписать руками. Сначала создайте `manager/templates/my-brand/`, потом выберите его в **Админ → Системные настройки**. -Вам также придется скопировать этот каталог: +## Что обязано быть в теме ->manager/controllers/default +Эти файлы читаются из каталога темы, без отката на `default`: -в новый каталог с тем же именем, что и ваш новый пользовательский каталог, например: +| Файл | Что ломается без него | +| --- | --- | +| `images/modx-icon-color.svg` | Значок сайта в шапке менеджера. | +| `images/modx-logo-color.svg` | Логотип на странице входа. | +| `images/login/default-background.jpg` | Фон страницы входа. | +| `email/default.tpl` | Создание пользователя: шаблон письма не найден. | ->manager/controllers/custom +**Стили страницы входа тема не перекрывает** +`security/login.tpl` подключает стиль темы `default` по жёстко заданному пути. Чтобы оформить его, положите `css/login.css` в каталог темы и поправьте ссылку в своей копии `security/login.tpl`. То же с браузером файлов: его `browser/index.tpl` подключает `css/index.css` темы `default`. -Это связано с тем, что при изменении значения системной настройки **manager_theme** она также будет ссылается на новый каталог контроллеров. +Стили самого менеджера тема перекрывает. Положите `css/index.css` в каталог темы, и шапка подхватит его через плейсхолдер `{$indexCss}`. + +## Где должна лежать тема + +Каталог темы ищется внутри `manager/templates/`. Это часть каталога установки, и обновление его перезаписывает. Держите файлы темы в своём репозитории и восстанавливайте их после обновления. + +**Обновление с Evolution сбрасывает тему** +Когда установщик обновляет сайт с Evolution, `setup/includes/upgrade.install.php` возвращает `manager_theme` в `default`. Обновление внутри MODX 3 настройку не трогает. + +## Переопределение контроллера + +Контроллер переопределяется так же. В пути вместо `templates` стоит `controllers`. Файл в теме называется так же, как в `default` (`.class.php`). Класс внутри него называется `ManagerController` в глобальном пространстве, например `SecurityLoginManagerController`. + +## Смотрите также + +1. [Настройка системы управления для клиента](building-sites/client-proofing) +2. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) +3. [Настройка входа в Менеджер](building-sites/client-proofing/manager-login) +4. [Дашборды](building-sites/client-proofing/dashboards) diff --git a/ru/building-sites/client-proofing/dashboards/creating-a-widget.md b/ru/building-sites/client-proofing/dashboards/creating-a-widget.md index 55bf8cf75..55f6fd930 100644 --- a/ru/building-sites/client-proofing/dashboards/creating-a-widget.md +++ b/ru/building-sites/client-proofing/dashboards/creating-a-widget.md @@ -1,22 +1,25 @@ --- title: "Создание виджета панели управления" translation: "building-sites/client-proofing/dashboards/creating-a-widget" +description: "Создание виджета панели управления в MODX: поля виджета, размеры и как поместить его на панель." --- -В этой статье описано, как создать собственный виджет панели управления, включая краткий обзор типов виджетов и принципов их работы. - ## Создание базового виджета -Откройте страницу панелей управления (**Dashboard → Dashboards** в верхнем меню) и перейдите на вкладку **Widgets**. Нажмите **Create New Widget**. Откроется экран создания виджета. Вы увидите несколько полей: +Откройте страницу панелей управления (**Админ → Панели управления** в верхнем меню) и перейдите на вкладку **Виджеты**. Нажмите **Создать**. Откроется экран создания виджета. На нём эти поля: -- **Name** - имя виджета. Назовём наш «Hello World». -- **Description** - краткое описание виджета для внутреннего использования. -- **Widget Type** - тип виджета. Подробнее об этом ниже. Пока выберите **HTML**. -- **Size** - размер виджета: half, full или double. Half занимает половину строки. Full занимает целую строку. Double занимает две строки. -- **Namespace** - пространство имён, с которым связан виджет. Полезно разработчикам Extras. Мы оставим **core**. -- **Lexicon** - позволяет загрузить лексикон для виджета. Оставим значение по умолчанию **core:dashboards**. +| Поле | Что в нём | +| --- | --- | +| **Name** | Имя виджета. Оно должно быть уникальным. | +| **Description** | Краткое описание виджета для внутреннего использования. | +| **Widget Type** | Тип виджета. Для первого виджета выберите «HTML». | +| **Size** | Один из семи размеров: Quarter, One Third, Half, Two Third, Three Quarters, Full Size и Double Size. | +| **Permission** | Право менеджера, которое нужно пользователю, чтобы виджет появился. Пусто: виджет виден всем. | +| **Namespace** | Пространство имён, с которым связан виджет. Оставьте «core», если вы не пишете дополнение. | +| **Lexicon** | Лексикон, который грузится вместе с виджетом. По умолчанию «core:dashboards». | +| **Properties** | Произвольные свойства виджета, которые хранятся в JSON. Виджет-файл или виджет-сниппет получает их как `$scriptProperties`. | -Когда вы вводите имя виджета, под полем появляется текст, повторяющий ваш ввод. Это автоматический перевод имён виджетов. Если ввести ключ записи лексикона, он переведётся (попробуйте `widget_create`, чтобы увидеть, как это работает). +Когда вы вводите имя, под полем появляется текст, повторяющий ввод. Это перевод имени: он ищет ключ в лексиконе виджета. Введите ключ существующей записи, например `w_configcheck`, и увидите переведённое имя. В содержимое виджета вставьте: @@ -32,37 +35,45 @@ translation: "building-sites/client-proofing/dashboards/creating-a-widget" ### Назначение виджета панели по умолчанию -Вернитесь на главную страницу панелей управления, откройте вкладку **Dashboards** и найдите панель по умолчанию. Щёлкните по ней правой кнопкой мыши и выберите **Update Dashboard**. Откроется страница редактирования. +Вернитесь на главную страницу панелей управления, откройте вкладку **Dashboards** и найдите панель по умолчанию. Щёлкните по ней правой кнопкой мыши и выберите **Редактировать**. Откроется страница редактирования. -Нажмите **Place Widget** над таблицей виджетов. Выберите **Hello World** в выпадающем списке и сохраните. Виджет добавлен на панель. Перетащите его на позицию №2 между виджетами **Configuration Check** и **MODX News Feed**: +Нажмите **Добавить виджет** над таблицей виджетов. Выберите **Hello World** в выпадающем списке и сохраните. Виджет добавлен на панель. Перетащите его на позицию №2 между виджетами **Configuration Check** и **MODX News Feed**: ![](dashboard-create2.png) Сохраните панель. -> **Примечание:** Добавление виджета через менеджер панелей (как описано выше) помещает его в **шаблон** панели. Если панель [настраиваемая](building-sites/client-proofing/dashboards "Dashboards"), виджет автоматически появится у всех существующих пользователей этой панели, а также у новых. +> [!NOTE] +> Добавление виджета через страницу панелей помещает его в **шаблон** панели. Если панель [настраиваемая](building-sites/client-proofing/dashboards "Панели управления"), виджет появляется у всех существующих пользователей этой панели и у новых. +> +> Добавление виджета прямо на странице панели добавляет его только текущему пользователю. Остальные его не увидят, пока виджет не добавят в шаблон. > -> Добавление виджета прямо на странице панели (через сам просмотр панели) добавляет его только для текущего пользователя. Другие пользователи его не увидят, пока виджет не добавят в шаблон. +> Виджет, добавленный в шаблон, приходит к существующим пользователям со стандартным размером и в конце списка, а не с тем размером, который указан в шаблоне. > -> На крупных сайтах с большим числом пользователей добавление виджета в шаблон создаёт запись размещения для каждого пользователя, у которого уже есть личная копия этой панели. Учитывайте это, если важна производительность. +> На крупном сайте добавление виджета в шаблон создаёт запись размещения для каждого пользователя с личной копией этой панели. Учитывайте это, если важна производительность. ### Просмотр виджета -Нажмите пункт **Dashboard** в верхнем меню. Вы увидите новый виджет на панели. +Нажмите логотип MODX в левом верхнем углу. На панели будет новый виджет. ![](dashboard-create3.png) +## Удаление виджета + +Виджет удаляется на вкладке **Виджеты**, и при этом он убирается со всех панелей, где он был размещён. Виджеты, которые поставляются с MODX, удалить нельзя. + ## Другие типы виджетов -Доступны и другие типы виджетов. См. раздел [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types "Dashboard Widget Types"). +Другие типы описаны в разделе [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types "Типы виджетов панели управления"). ## Смотрите также -1. [Управление панелью](building-sites/client-proofing/dashboards/managing) -2. [Назначение панели группе пользователей](building-sites/client-proofing/dashboards/usergroups) -3. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) - 1. [Тип виджета - файл](building-sites/client-proofing/dashboards/widget-types/file) - 2. [Тип виджета - HTML](building-sites/client-proofing/dashboards/widget-types/html) - 3. [Тип виджета - inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Тип виджета - сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Панели управления](building-sites/client-proofing/dashboards) +2. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) +3. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) +4. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) + 1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) + 2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) + 3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) + 4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/dashboards/index.md b/ru/building-sites/client-proofing/dashboards/index.md index 9ef847550..b6459259b 100644 --- a/ru/building-sites/client-proofing/dashboards/index.md +++ b/ru/building-sites/client-proofing/dashboards/index.md @@ -1,25 +1,46 @@ --- title: "Панели управления" translation: "building-sites/client-proofing/dashboards" +description: "Панель управления в MODX: виджеты на странице, которую видит пользователь после входа, штатные виджеты и личная копия панели у каждого пользователя." --- -## Что такое панели управления? +## Что такое панель управления -Панель управления в MODX это страница, которая отображается при первой загрузке менеджера MODX или при нажатии ссылки «Панель управления» в левом верхнем углу экрана. Панели управления могут содержать неограниченное количество «виджетов», то есть блоков с разным содержимым на панели. Вы можете расположить виджеты в любом порядке. Виджет может быть файлом, сниппетом MODX или обычным HTML. +Панель управления — это страница, которая открывается при входе в менеджер. Логотип MODX в левом верхнем углу ведёт на неё же. -Каждой группе пользователей в MODX по умолчанию назначается панель управления. Это означает, что вы можете выдать разным пользователям разные панели через группу пользователей, к которой они принадлежат. +На панели может быть сколько угодно виджетов: блоков с содержимым. Виджет — это файл, сниппет MODX, обычный HTML или PHP-код. Виджеты можно располагать в любом порядке. -Если пользователь входит в две разные группы, он увидит панель своей основной группы. Её можно задать на экране редактирования пользователя. +Каждой группе пользователей назначается своя панель. Так разным пользователям достаются разные панели. + +Если пользователь состоит в двух группах, используется панель его основной группы. Основную группу задают на экране редактирования пользователя. + +## Штатные виджеты + +В MODX поставляется семь виджетов: + +| Виджет | Право | +| --- | --- | +| MODX News Feed | — | +| MODX Security Feed | — | +| Who's Online | — | +| Configuration Check | — | +| Buttons | — | +| Recently Edited Resources | `view_document` | +| Updates | `workspaces` | + +Последние два видны только пользователям с нужным правом, поэтому у обычного пользователя их на панели нет. ## Настраиваемые панели -У панелей есть параметр **Customizable** (настраиваемая). Если он включён (по умолчанию включён), MODX клонирует раскладку виджетов панели для каждого пользователя при первой загрузке. У каждого появляется личная копия панели, которую он может переставлять, дополнять виджетами или очищать без влияния на других. +У панели есть параметр **Customizable** (настраиваемая). Если он включён (по умолчанию включён), MODX клонирует раскладку виджетов панели для каждого пользователя при первой загрузке. У каждого появляется личная копия: можно менять порядок, добавлять и убирать виджеты, а также менять их размер, не затрагивая остальных. Если **Customizable** выключен, все пользователи видят одну и ту же раскладку и не могут менять её для себя. +У панели есть и второй параметр — **Hide Left-Hand Trees**: он прячет деревья слева, пока показана панель. + ### Как изменения шаблона распространяются на пользователей -Раскладка виджетов, которую вы настраиваете на странице управления панелями (Панель управления -> Панели управления -> Редактировать панель), служит **шаблоном** для настраиваемой панели. Когда вы добавляете или удаляете виджеты в шаблоне, изменения применяются ко всем пользователям, у которых уже есть личная копия этой панели: +Раскладка виджетов, которую вы настраиваете на странице управления панелями, служит **шаблоном** настраиваемой панели. Когда вы добавляете или удаляете виджеты в шаблоне, изменения применяются ко всем пользователям, у которых уже есть личная копия этой панели: - **Добавленные** в шаблон виджеты автоматически появятся у всех пользователей с личной копией панели. - **Удалённые** из шаблона виджеты исчезнут с личных панелей всех пользователей. @@ -28,36 +49,19 @@ translation: "building-sites/client-proofing/dashboards" Изменения, которые вы делаете прямо на странице панели пользователя (например, закрываете виджет кнопкой или добавляете виджет с самой панели), затрагивают только этого пользователя и не меняют шаблон. -## Настраиваемые панели - -У панелей есть параметр **Customizable** / «Настраиваемая». Если он включён (так по умолчанию), MODX при первой загрузке панели клонирует раскладку виджетов для каждого пользователя. У пользователя появляется личная копия: можно менять порядок, добавлять и убирать виджеты, не затрагивая остальных. - -Если **Customizable** выключен, все пользователи делят одну раскладку и не правят её лично. - -### Как изменения шаблона доходят до пользователей - -Раскладка виджетов на странице Dashboards → Update Dashboard — это **шаблон** настраиваемой панели. Добавление или удаление виджетов в шаблоне применяется ко всем, у кого уже есть личная копия: - -- **Добавленные** в шаблон виджеты появятся у всех пользователей этой панели. -- **Удалённые** из шаблона виджеты пропадут у всех личных копий. - -Личный порядок виджетов от правок шаблона не сбрасывается. - -Правки прямо на странице панели пользователя (кнопка закрытия виджета или добавление с самой панели) затрагивают только этого пользователя и не меняют шаблон. +Виджет, добавленный в шаблон, приходит к существующим пользователям со стандартным размером и в конце списка, а не с тем размером, который указан в шаблоне. -## Использование панелей +## Права -- [Редактирование панели управления](building-sites/client-proofing/dashboards/managing "Редактирование панели управления") -- [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups "Назначение панели управления группе пользователей") -- [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget "Создание виджета панели управления") -- [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types "Типы виджетов панели управления") +Страница менеджера с панелями и любые действия с виджетами требуют права **dashboards**. Сама панель показывается любому пользователю, которому разрешён вход в менеджер. ## Смотрите также -1. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) -2. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) -3. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) +1. [Панели управления](building-sites/client-proofing/dashboards) +2. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) +3. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) +4. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) 1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) 2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) diff --git a/ru/building-sites/client-proofing/dashboards/managing.md b/ru/building-sites/client-proofing/dashboards/managing.md index 837a69604..646ce6f6b 100644 --- a/ru/building-sites/client-proofing/dashboards/managing.md +++ b/ru/building-sites/client-proofing/dashboards/managing.md @@ -1,46 +1,49 @@ --- title: "Редактирование панели управления" translation: "building-sites/client-proofing/dashboards/managing" +description: "Редактирование панели управления в MODX: назначение и размещение виджетов, своя панель и порядок изменений шаблона." --- -В этой статье описано, как редактировать панель управления, в том числе как назначать и размещать виджеты на этой панели. - ## Редактирование панели управления -Откройте главную страницу панелей управления в верхнем меню: «Панель управления» -> «Панели управления». После загрузки на первой вкладке вы увидите таблицу с (скорее всего) одной панелью, «Default». Щёлкните по строке правой кнопкой мыши и выберите «Редактировать панель». Откроется страница редактирования панели. +Откройте главную страницу панелей управления: в верхнем меню это **Админ → Панели управления**. На первой вкладке вы увидите таблицу панелей, скорее всего только «Default». Щёлкните по строке правой кнопкой мыши и выберите **Редактировать**. Откроется страница редактирования панели. -Ниже полей имени и описания вы увидите таблицу виджетов, назначенных на панель. Перетаскивайте виджеты, чтобы изменить порядок. Добавляйте виджеты кнопкой «Place Widget». Удаляйте виджеты через контекстное меню по правому щелчку: +Ниже полей имени и описания вы увидите таблицу виджетов панели. Перетаскивайте виджеты, чтобы изменить порядок. Добавляйте виджеты кнопкой **Добавить виджет**. Удаляйте виджеты через контекстное меню по правому щелчку: ![](dashboard-edit.png) -## Шаблон и личные изменения +Имя панели Default в форме изменить нельзя. Описание можно. Это панель, которую видит пользователь, которому не назначили другую. -Изменения на этой странице обновляют **шаблон** панели. Для [настраиваемых панелей](building-sites/client-proofing/dashboards "Панели управления") изменения шаблона распространяются на всех пользователей с личной копией этой панели: +## Создание и удаление панели -- Если вы **добавите виджет** здесь, он появится на панели у всех существующих пользователей этой панели. -- Если вы **удалите виджет** здесь, он исчезнет с личных панелей всех пользователей. +На странице есть кнопка **Создать**, которая делает вашу собственную панель. В контекстном меню панели рядом с **Редактировать** есть **Дублировать** и **Удалить**. Дублирование копирует виджеты и их размещение. Копию вы меняете как хотите. -Это отличается от изменений прямо на странице панели (например, закрытие виджета кнопкой или добавление виджета из вида панели). Такие правки затрагивают только текущего пользователя. +Панель «Default» удалить нельзя. Когда панель удаляют, назначенные ей группы возвращаются к «Default». -Если вы хотите применить изменение виджета ко всем пользователям, сделайте это на этой странице управления. Если нужно настроить только свою панель, меняйте её прямо на странице панели. +Таблицу панелей можно фильтровать по группе пользователей. Так быстрее всего найти панель конкретной группы. -## Шаблон и личные правки +## Шаблон и личные изменения Изменения на этой странице обновляют **шаблон** панели. Для [настраиваемых панелей](building-sites/client-proofing/dashboards "Панели управления") правки шаблона доходят до всех пользователей с личной копией: - **Добавление виджета** здесь покажет его всем текущим пользователям панели. - **Удаление виджета** здесь уберёт его из всех личных панелей. -Это отличается от правок прямо на странице панели (кнопка закрытия виджета или добавление с панели). Такие правки касаются только текущего пользователя. +Правки прямо на странице панели устроены иначе. Кнопка закрытия виджета и добавление виджета с самой панели касаются только текущего пользователя. + +Виджет, добавленный в шаблон, приходит к существующим пользователям со стандартным размером и в конце списка. + +## Права -Чтобы изменить виджеты для всех, правьте эту страницу управления. Чтобы поправить только свою панель, меняйте её на самой странице Dashboard. +Любое действие на этой странице требует права **dashboards**. ## Смотрите также -1. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) -2. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) -3. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) +1. [Панели управления](building-sites/client-proofing/dashboards) +2. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) +3. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) +4. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) 1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) 2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) 3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) diff --git a/ru/building-sites/client-proofing/dashboards/usergroups.md b/ru/building-sites/client-proofing/dashboards/usergroups.md index db9e6f266..4b0a99428 100644 --- a/ru/building-sites/client-proofing/dashboards/usergroups.md +++ b/ru/building-sites/client-proofing/dashboards/usergroups.md @@ -1,29 +1,33 @@ --- title: "Назначение панели группе пользователей" translation: "building-sites/client-proofing/dashboards/usergroups" +description: "Назначение панели управления группе пользователей в MODX и то, как у участников группы появляется личная копия настраиваемой панели." --- -Как назначить Dashboard группе пользователей. +В этой статье описано, как назначить панель управления группе пользователей. -Найдите нужную User Group и откройте её на редактирование: **Меню → Access Controls**, ПКМ по группе в дереве, **Update User Group**. +Сначала найдите группу пользователей, которой вы хотите назначить панель, и откройте её на правку. Дерево групп пользователей живёт на странице **Access → ACLs**: щёлкните по группе в дереве правой кнопкой мыши и выберите **Edit User Group**. -В выпадающем списке **Dashboard** выберите панель. Все пользователи группы, у которых эта группа основная (Primary Group), будут видеть эту панель вместо Default. +Дальше нажмите на выпадающий список «Dashboard» и выберите панель, которую хотите назначить этой группе. Все пользователи группы, у которых она основная, будут открывать эту панель вместо «Default». ![](dashboard-assign.png) -## Настраиваемые панели и группы +Панель назначается в форме группы. Обратного экрана, где панель назначалась бы группам, нет. -Если у назначенной панели включено **Customizable**, при первом входе MODX создаёт личную копию раскладки виджетов для пользователя. Он может менять, добавлять и убирать виджеты на своей копии. На других членов группы это не влияет. +## Настраиваемые панели и группы пользователей -Когда администратор позже меняет шаблон панели (добавляет или убирает виджеты на странице Dashboards), изменения применяются ко всем личным копиям. Как шаблон распространяется, см. [Managing Your Dashboard](building-sites/client-proofing/dashboards/managing). +Если у назначенной панели включён параметр **Customizable** (настраиваемая), MODX при первой загрузке панели клонирует раскладку виджетов для каждого пользователя. Пользователь может переставлять, добавлять и убирать виджеты на своей копии, не затрагивая остальных участников группы. + +Когда администратор позже меняет шаблон панели (добавлением или удалением виджетов на странице управления панелями), правки применяются ко всем личным панелям существующих пользователей. Подробнее об этом — в статье [Редактирование панели управления](building-sites/client-proofing/dashboards/managing "Редактирование панели управления"). ## Смотрите также -1. [Управление панелью](building-sites/client-proofing/dashboards/managing) -2. [Назначение панели группе пользователей](building-sites/client-proofing/dashboards/usergroups) -3. [Создание виджета](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Типы виджетов](building-sites/client-proofing/dashboards/widget-types) - 1. [Тип File](building-sites/client-proofing/dashboards/widget-types/file) - 2. [Тип HTML](building-sites/client-proofing/dashboards/widget-types/html) - 3. [Тип Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Тип Snippet](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Панели управления](building-sites/client-proofing/dashboards) +2. [Редактирование панели управления](building-sites/client-proofing/dashboards/managing) +3. [Назначение панели управления группе пользователей](building-sites/client-proofing/dashboards/usergroups) +4. [Создание виджета панели управления](building-sites/client-proofing/dashboards/creating-a-widget) +5. [Типы виджетов панели управления](building-sites/client-proofing/dashboards/widget-types) + 1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) + 2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) + 3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) + 4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/dashboards/widget-types/file.md b/ru/building-sites/client-proofing/dashboards/widget-types/file.md index 71d8c69c0..3d40bfe05 100644 --- a/ru/building-sites/client-proofing/dashboards/widget-types/file.md +++ b/ru/building-sites/client-proofing/dashboards/widget-types/file.md @@ -1,12 +1,14 @@ --- title: "Файлы" translation: "building-sites/client-proofing/dashboards/widget-types/file" +description: "Виджет панели управления типа «Файл» в MODX: способы вернуть содержимое виджета из файла." --- Тип виджета File Dashboard запускает файл из файловой системы. Результатом работы может быть: -- возврат результата работы файла отрендарив его в панели содержимого виджета. -- возврат имени класса, который расширяет `modDashboardWidgetInterface`, абстрактный класс, предоставляемый MODX, который имеет метод render(), который будет возвращать выходные данные для визуализации на панель содержимого виджета. +- возврат результата работы файла с отрисовкой его в панели содержимого виджета; +- вывод результата работы файла без `return`; +- возврат имени класса, который расширяет `modDashboardWidgetInterface` — абстрактный класс, предоставляемый MODX, у которого есть метод `render()`, возвращающий вывод для панели содержимого виджета. ## Использование @@ -18,16 +20,30 @@ translation: "building-sites/client-proofing/dashboards/widget-types/file" - `[[++assets_path]]` - `[[++manager_theme]]` -### Вывод результата +**Используйте абсолютный путь** +Относительный путь разрешается от рабочего каталога процесса PHP, а не от корня MODX, поэтому он не переносится между установками. Соберите путь из `[[++manager_path]]` и подобных. + +### Возврат результата -Существует два метода, при помощи которых можно вернуть результаты работы вашего файла. Первый - просто вернуть результат: +Первый способ — просто вернуть результат: ``` php resource, будут проблемы. +Обратите внимание, что на панели управления нет активного ресурса, поэтому у сниппета, который ссылается на `$modx->resource`, будут проблемы. ## Смотрите также -1. [Тип виджета панели инструментов - Файл](building-sites/client-proofing/dashboards/widget-types/file) -2. [Тип виджета панели инструментов - HTML](building-sites/client-proofing/dashboards/widget-types/html) -3. [Тип виджета Dashboard - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) -4. [Тип виджета на приборной панели - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) +2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) +3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) +4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/dashboards/widget-types/index.md b/ru/building-sites/client-proofing/dashboards/widget-types/index.md index 4ddfdd3e4..89897039d 100644 --- a/ru/building-sites/client-proofing/dashboards/widget-types/index.md +++ b/ru/building-sites/client-proofing/dashboards/widget-types/index.md @@ -1,22 +1,21 @@ --- -title: "Типы Виджетов" +title: "Типы виджетов" translation: "building-sites/client-proofing/dashboards/widget-types" +description: "Типы виджетов панели управления в MODX и значение, под которым хранится каждый из них." --- -В этой статье перечислены различные типы доступных виджетов Dashboard. +Виджет панели управления хранит своё содержимое в одном из четырёх типов. Тип сохраняется вместе с виджетом, и его значение важно, когда вы пишете виджет сами. -1. [Тип виджета панели инструментов - Файл](building-sites/client-proofing/dashboards/widget-types/file) -2. [Тип виджета панели инструментов - HTML](building-sites/client-proofing/dashboards/widget-types/html) -3. [Тип виджета Dashboard - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) -4. [Тип виджета на приборной панели - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +| Тип | Что делает | Значение в базе | +| --- | --- | --- | +| [Файл](building-sites/client-proofing/dashboards/widget-types/file "Тип виджета панели управления - Файл") | Выполняет файл с диска. | `file` | +| [Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet "Тип виджета панели управления - Сниппет") | Выполняет сниппет MODX. | `snippet` | +| [HTML](building-sites/client-proofing/dashboards/widget-types/html "Тип виджета панели управления - HTML") | Показывает обычный HTML. | `html` | +| [Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php "Тип виджета панели управления - Inline PHP") | Выполняет PHP-код, как сниппет. | `php` | ## Смотрите также -1. [Управление вашей приборной панелью](building-sites/client-proofing/dashboards/managing) -2. [Назначение панели мониторинга для группы пользователей](building-sites/client-proofing/dashboards/usergroups) -3. [Создание виджета панели инструментов](building-sites/client-proofing/dashboards/creating-a-widget) -4. [Типы виджетов на приборной панели](building-sites/client-proofing/dashboards/widget-types) - 1. [Тип виджета панели инструментов - Файл](building-sites/client-proofing/dashboards/widget-types/file) - 2. [Тип виджета панели инструментов - HTML](building-sites/client-proofing/dashboards/widget-types/html) - 3. [Тип виджета Dashboard - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) - 4. [Тип виджета на приборной панели - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) +2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) +3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) +4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/dashboards/widget-types/inline-php.md b/ru/building-sites/client-proofing/dashboards/widget-types/inline-php.md index dc13c943a..c526f276d 100644 --- a/ru/building-sites/client-proofing/dashboards/widget-types/inline-php.md +++ b/ru/building-sites/client-proofing/dashboards/widget-types/inline-php.md @@ -1,30 +1,31 @@ --- title: "Inline PHP" translation: "building-sites/client-proofing/dashboards/widget-types/inline-php" +description: "Виджет панели управления Inline PHP в MODX: PHP-код, который выполняется как сниппет, и правила, которых он должен держаться." --- -Виджет Inline PHP работает как и [виджет Snippet](building-sites/client-proofing/dashboards/widget-types/snippet "Тип виджета на приборной панели - сниппет"), за исключением того, что он запускает содержимое виджета, как будто это был Snippet. +Виджет Inline PHP работает почти так же, как [виджет-сниппет](building-sites/client-proofing/dashboards/widget-types/snippet "Тип виджета панели управления - Сниппет"), только выполняет содержимое виджета как сниппет. ## Использование -Просто поместите ваш PHP-код в панель содержимого и верните вывод вашего виджета. +Просто поместите PHP-код в панель содержимого и верните результат. -Например, это отобразит «Hello, World!»: +Например, так выведется «Hello, World!»: -```php +``` php resource в вашем виджете, так как нет активного ресурса для панели инструментов -- Не помещайте закрывающий тег PHP в конец кода! По какой-то причине он анализируется неправильно (по состоянию на MODX 2.2.8) +- Используйте `return`, а не `echo`. Напечатанное попадёт в вывод страницы, а не в содержимое виджета. +- Не используйте `$modx->resource` в виджете: у панели управления нет активного ресурса. +- Теги `` вырезаются перед выполнением кода, поэтому закрывающий тег не нужен. ## Смотрите также -1. [Тип виджета панели инструментов - Файл](building-sites/client-proofing/dashboards/widget-types/file) -2. [Тип виджета панели инструментов - HTML](building-sites/client-proofing/dashboards/widget-types/html) -3. [Тип виджета Dashboard - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) -4. [Тип виджета на приборной панели - сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) +2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) +3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) +4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/dashboards/widget-types/snippet.md b/ru/building-sites/client-proofing/dashboards/widget-types/snippet.md index b5fde2aa0..84c856966 100644 --- a/ru/building-sites/client-proofing/dashboards/widget-types/snippet.md +++ b/ru/building-sites/client-proofing/dashboards/widget-types/snippet.md @@ -1,6 +1,7 @@ --- title: "Сниппет" translation: "building-sites/client-proofing/dashboards/widget-types/snippet" +description: "Виджет панели управления типа «Сниппет» в MODX: сниппет, который возвращает содержимое виджета." --- Тип виджета «Панель инструментов Snippet» запускает сниппет кода MODX и помещает возвращаемое значение в панель виджетов. @@ -17,7 +18,7 @@ MyCustomDashboardSnippet ## Смотрите также -1. [Тип виджета панели инструментов - Файл](building-sites/client-proofing/dashboards/widget-types/file) -2. [Тип виджета панели инструментов - HTML](building-sites/client-proofing/dashboards/widget-types/html) -3. [Тип виджета Dashboard - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) -4. [Тип виджета на приборной панели - сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) +1. [Тип виджета панели управления - Файл](building-sites/client-proofing/dashboards/widget-types/file) +2. [Тип виджета панели управления - HTML](building-sites/client-proofing/dashboards/widget-types/html) +3. [Тип виджета панели управления - Inline PHP](building-sites/client-proofing/dashboards/widget-types/inline-php) +4. [Тип виджета панели управления - Сниппет](building-sites/client-proofing/dashboards/widget-types/snippet) diff --git a/ru/building-sites/client-proofing/form-customization/fc_new_tab.jpg b/ru/building-sites/client-proofing/form-customization/fc_new_tab.jpg new file mode 100644 index 000000000..86dd98b7a Binary files /dev/null and b/ru/building-sites/client-proofing/form-customization/fc_new_tab.jpg differ diff --git a/ru/building-sites/client-proofing/form-customization/index.md b/ru/building-sites/client-proofing/form-customization/index.md index 1faede88f..14e9a45cd 100644 --- a/ru/building-sites/client-proofing/form-customization/index.md +++ b/ru/building-sites/client-proofing/form-customization/index.md @@ -1,38 +1,46 @@ --- title: "Настройка менеджера" translation: "building-sites/client-proofing/form-customization" +description: "Настройка форм в MODX: профили, наборы и правила, которые меняют формы менеджера." --- -## Что такое настройка формы? +## Что такое настройка форм -Настройка формы - позволяет пользователям создавать правила, которые определяют, как страницы менеджера отображают свои формы в MODX Revolution Manager. +Настройка форм позволяет менять формы менеджера: спрятать поле, переименовать его, подставить другое значение, перенести TV на другую вкладку. -## Как это работает? +Раздел находится в **Админ → Настройка форм** и требует права **customize_forms**. -В настоящее время форма настройки имеет 3 слоя: +## Три слоя -> Профиль -> Наборы -> Правила +> Профиль → Набор → Правила -Профиль - это набор Наборов, а Наборы - это набор Правил. Профили могут быть ограничены определенными группами пользователей. +**Профиль** собирает наборы. Его можно привязать к группам пользователей. **Набор** собирает правила и привязан к странице менеджера. **Правило** вносит в форму одно изменение. -Набор представляет собой набор правил и привязан к определенному представлению. Обычно у вас есть Набор для страницы Ресурс / Создать и Набор для страницы Ресурс / Обновление. Наборы также могут быть привязаны к определенным [шаблонам](building-sites/elements/templates "Шаблоны") (то есть они загружаются, только когда ресурс использует этот шаблон). У них также может быть набор «Ограничение», который ограничивает выполнение набора ограничением, установленным в Ограничении. +Правила не правятся отдельно: они пересобираются из трёх сеток набора при каждом его сохранении. Смотрите [Правила настройки формы](building-sites/client-proofing/form-customization/rules "Правила настройки формы"). -Правило - это все варианты, применяемые в наборе. Правила скрыты от просмотра в MODX Revolution, но вместо этого отображаются в виде полей на странице «Редактирование набора». +## Как это хранится -Более подробную информацию о каждой части настройки формы можно найти на соответствующей странице каждой части: +Профиль хранит наборы. Набор хранит свои правила. Список полей и областей, которые можно менять, хранится в справочнике и заполняется при установке MODX. -1. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) -2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) - 1. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs) -3. [Шаблоны и темы менеджера](building-sites/client-proofing/custom-manager-themes) +## Какие формы можно настроить -### Какие формы я могу настроить? +Только страницы ресурса: **Create Resource** и **Edit Resource**. Страницы чанка, сниппета, пользователя или группы пользователей настройка форм не покрывает. -Страницы создания и обновления ресурса могут быть настроены в это время в настройке формы. +Набор привязывается к одному из трёх действий: + +| Действие | Набор действует на | +| --- | --- | +| Create Resource | Страницу создания ресурса. | +| Edit Resource | Страницу редактирования ресурса. | +| Create & Edit Resource | На обе страницы сразу. | + +В последнем случае набор покрывает обе страницы. Список полей и областей он берёт со страницы редактирования ресурса. ## Смотрите также -1. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) -2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) - 1. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs) -3. [Шаблоны и темы менеджера](building-sites/client-proofing/custom-manager-themes) +1. [Настройка менеджера](building-sites/client-proofing/form-customization) +2. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) +3. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) + 1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) + 2. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) +4. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) diff --git a/ru/building-sites/client-proofing/form-customization/profiles.md b/ru/building-sites/client-proofing/form-customization/profiles.md index a9d6bc0c7..51e426257 100644 --- a/ru/building-sites/client-proofing/form-customization/profiles.md +++ b/ru/building-sites/client-proofing/form-customization/profiles.md @@ -1,17 +1,23 @@ --- title: "Профили" translation: "building-sites/client-proofing/form-customization/profiles" +description: "Профиль настройки формы в MODX: набор наборов, привязанный к группам пользователей, которые их получают." --- -## Что такое профиль настройки формы? +## Что такое профиль настройки формы -Профиль - это набор [наборов настроек формы](building-sites/client-proofing/form-customization/sets "Наборы настроек формы") . Профиль может быть ограничен для загрузки только для определенных групп пользователей. Если группы пользователей не назначены, профиль будет запущен для всех пользователей. +Профиль — это набор [наборов настроек формы](building-sites/client-proofing/form-customization/sets "Наборы настроек формы"). Профиль можно ограничить так, чтобы он загружался только для определённых групп пользователей. Если группы пользователей не назначены, профиль будет запущен для всех пользователей. -Он также может быть помечен как «неактивный», что отключит его выполнение. +Его также можно пометить как «неактивный», что отключит его выполнение. + +**Сопоставляется только основная группа пользователя** +По умолчанию профиль сопоставляется с основной группой пользователя. Профиль, привязанный к вторичной группе, не действует, пока не включена настройка `form_customization_use_all_groups`. ## Смотрите также -1. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) -2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) - 1. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs) -3. [Шаблоны и темы менеджера](building-sites/client-proofing/custom-manager-themes) +1. [Настройка менеджера](building-sites/client-proofing/form-customization) +2. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) +3. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) + 1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) + 2. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) +4. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) diff --git a/ru/building-sites/client-proofing/form-customization/rules/field-default.md b/ru/building-sites/client-proofing/form-customization/rules/field-default.md index 05f0344fb..ce325eb0e 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/field-default.md +++ b/ru/building-sites/client-proofing/form-customization/rules/field-default.md @@ -1,22 +1,25 @@ --- -title: "Поле по-умолчанию" +title: "Значение поля по умолчанию" translation: "building-sites/client-proofing/form-customization/rules/field-default" +description: "Правило «Значение поля по умолчанию» набора настройки формы в MODX: как оно подставляет значение в поле формы." --- -## Правило по умолчанию для поля +## Что делает правило -Правило поля по умолчанию, если оно установлено, автоматически устанавливает значение поля по умолчанию. +Подставляет значение в поле формы менеджера. Значение появляется, когда форма открывается, и остаётся в поле, если пользователь сохранит форму, не меняя его. -Это будет работать только на «создавать» страницы, а **не** «обновлять» страницы. +Правило применяется на той странице, к которой привязан набор, — и на странице создания ресурса, и на странице редактирования. Чтобы оно действовало только при создании, привяжите набор к действию **Create Resource**, а не к **Create & Edit Resource**. -## Примеры +## Где задаётся -Пример правила установки категории по умолчанию для [сниппета](extending-modx/snippets "сниппет") для всех [пользователей](building-sites/client-proofing/security/users "пользователей") в отделе кадров группы пользователей будет выглядеть следующим образом: +Вкладка **Поля** набора, колонка **Default Value**. Поле со значением получает правило; пустая ячейка удаляет его. -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-fielddefault1.png) +## Шаблон нового ресурса + +На поле `template` правило задаёт шаблон, который получает новый ресурс. Это поле предлагается только набору, привязанному к действию **Create Resource**. ## Смотрите также -```php - [[getResources@section? &parents=`122` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/field-label.md b/ru/building-sites/client-proofing/form-customization/rules/field-label.md index 1c463ebd3..723a784b3 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/field-label.md +++ b/ru/building-sites/client-proofing/form-customization/rules/field-label.md @@ -1,20 +1,19 @@ --- -title: "Полевая Метка" +title: "Метка поля" translation: "building-sites/client-proofing/form-customization/rules/field-label" +description: "Правило «Метка поля» набора настройки формы в MODX: как оно переименовывает поле формы." --- -## Правило метки поля +## Что делает правило -Правило метки поля, если установлено, изменит метку поля на любое текстовое значение. +Заменяет метку поля формы текстом, который задали вы. Само поле сохраняет имя и значение, меняется только текст рядом с ним. -## Примеры +## Где задаётся -Пример правила изменения метки интротекста на «Комментарии» для [пользователей](building-sites/client-proofing/security/users "пользователей") в группе [пользователей](building-sites/client-proofing/security/user-groups "Группы пользователей") «Маркетинг» будет выглядеть следующим образом: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-fieldlabel.png) +Вкладка **Поля** набора, колонка **Label**. Поле со своей меткой получает правило; пустая ячейка оставляет штатную метку поля. ## Смотрите также -```php -[[getResources@section? &parents=`123` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/field-visible.md b/ru/building-sites/client-proofing/form-customization/rules/field-visible.md index a8853d0fa..014b23730 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/field-visible.md +++ b/ru/building-sites/client-proofing/form-customization/rules/field-visible.md @@ -1,20 +1,27 @@ --- -title: "Видимое поле" +title: "Видимость поля" translation: "building-sites/client-proofing/form-customization/rules/field-visible" +description: "Правило «Видимость поля» набора настройки формы в MODX: как оно прячет поле формы." --- -## Правило видимого поля +## Что делает правило -Правило видимости поля, если оно установлено, будет объявлять поле «видимым» или нет для пользователя. +Прячет поле формы менеджера. Поле не выводится вовсе, а значение ресурса в нём остаётся. -## Примеры +## Где задаётся -Пример правила сокрытия поля introtext от [пользователей](building-sites/client-proofing/security/users "пользователей") в группе [пользователей](building-sites/client-proofing/security/user-groups "Группы пользователей") «Отдел кадров» будет выглядеть так: +Вкладка **Поля** набора, колонка **Visible**. Снятая отметка у поля создаёт правило; поставленная обратно — удаляет его. -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-fieldvisible.png) +## К чему применяется + +К полям формы ресурса: + +`id`, `pagetitle`, `alias`, `longtitle`, `description`, `introtext`, `content`, `published`, `deleted`, `publishedon`, `pub_date`, `unpub_date`, `template`, `hidemenu`, `menutitle`, `link_attributes`, `menuindex`, `class_key`, `content_type`, `parent`, `content_dispo`, `isfolder`, `show_in_tree`, `hide_children_in_tree`, `alias_visible`, `uri_override`, `uri`, `richtext`, `cacheable`, `searchable`, `syncsite`. + +Список полей хранится в справочнике формы и заполняется при установке MODX. На базе, обновлённой с 2.x, список может быть короче. ## Смотрите также -```php -[[getResources@section? &parents=`124` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/index.md b/ru/building-sites/client-proofing/form-customization/rules/index.md index 93d6eac11..6822f171b 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/index.md +++ b/ru/building-sites/client-proofing/form-customization/rules/index.md @@ -1,16 +1,50 @@ --- title: "Правила настройки формы" -translation: "building-sites/client-proofing/form-customization/rules" +translation: "building-sites/client-proofing/form-customization/rules/index" +description: "Десять правил набора настройки формы в MODX: что делает каждое и в какой сетке набора оно задаётся." --- -## Что такое правило? +## Что такое правила -Правила в MODX Revolution - это просто общие правила, применимые к любому действию (страница менеджера). Они также могут быть привязаны к группам пользователей, где правило будет применяться только в том случае, если пользователь является частью этой группы пользователей. +Правила — это изменения, которые набор вносит в форму менеджера. Их десять, и каждое задаётся в одной из трёх сеток набора. -## Какие правила доступны? +| Правило | Что делает | Где задаётся | +| --- | --- | --- | +| [Видимость поля](building-sites/client-proofing/form-customization/rules/field-visible "Видимость поля") | Прячет поле формы. | Поля, **Visible** | +| [Метка поля](building-sites/client-proofing/form-customization/rules/field-label "Метка поля") | Переименовывает поле формы. | Поля, **Label** | +| [Значение поля по умолчанию](building-sites/client-proofing/form-customization/rules/field-default "Значение поля по умолчанию") | Подставляет значение в поле формы. | Поля, **Default Value** | +| [Видимость области](building-sites/client-proofing/form-customization/rules/tab-visible "Видимость области") | Прячет область формы. | Области, **Visible** | +| [Заголовок области](building-sites/client-proofing/form-customization/rules/tab-title "Заголовок области") | Переименовывает область формы. | Области, **Title** | +| [Новая область](building-sites/client-proofing/form-customization/rules/new-tab "Новая область") | Добавляет свою область в форму. | Области, **Create** | +| [Видимость TV](building-sites/client-proofing/form-customization/rules/tv-visible "Видимость TV") | Прячет TV формы. | Template Variables, **Visible** | +| [Заголовок TV](building-sites/client-proofing/form-customization/rules/tv-title "Заголовок TV") | Переименовывает TV формы. | Template Variables, **Label** | +| [Значение TV по умолчанию](building-sites/client-proofing/form-customization/rules/tv-default "Значение TV по умолчанию") | Задаёт значение по умолчанию для TV. | Template Variables, **Default Value** | +| [Перенос TV в другую область](building-sites/client-proofing/form-customization/rules/move-tv-to-tab "Перенос TV в другую область") | Переносит TV в другую область. | Template Variables, **Region** | -Доступные правила: +## Правила не правятся напрямую -```php -[[getResources@section? &parents=`133` &context=`revolution`]] -``` +В MODX 3 нет сетки правил. Правила пересобираются из трёх сеток набора при каждом его сохранении, поэтому меняете вы сетку, а не правило. + +Три сетки лежат на вкладках набора: + +- **Set Information and Fields** — сам набор и поля формы; +- **Regions** — области формы; +- **Template Variables** — TV, назначенные шаблону набора. + +## Порядок применения правил + +Правила применяются в фиксированном порядке, чтобы одно правило не отменяло другое: + +1. значение поля по умолчанию; +2. новая область, затем видимость и заголовок областей; +3. метка и видимость полей; +4. значение по умолчанию, метка и видимость TV; +5. перенос TV в другую область. + +Перенос идёт последним намеренно: TV можно перенести в область, которую тот же набор только что создал. + +## Смотрите также + +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md b/ru/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md index c764c7c2a..d6808807d 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md +++ b/ru/building-sites/client-proofing/form-customization/rules/move-tv-to-tab.md @@ -1,33 +1,24 @@ --- -title: "Переместить TV на вкладку" +title: "Перенос TV в другую область" translation: "building-sites/client-proofing/form-customization/rules/move-tv-to-tab" +description: "Правило «Перенос TV в другую область» набора настройки формы в MODX: как оно переносит TV." --- -## Правило перемещения TV на вкладку +## Что делает правило -Правило «Переместить TV на вкладку» переместит любой TV на указанную вами вкладку. +Переносит TV формы менеджера в другую область. TV выводится в этой области вместо той, к которой принадлежал. -## использование +## Где задаётся -Укажите идентификатор вкладки для перехода в поле «имя» правила. Затем укажите идентификатор TV с префиксом «tv» в поле «значение». +Вкладка **Template Variables** набора, колонка **Region**. Впишите туда идентификатор области, в которую нужно перенести переменную. -Список доступных вкладок: +**Идентификатор не проверяется** +В ячейку попадает ровно то, что вы вписали. Опечатка не сделает ничего, и сообщения об этом не будет. Возьмите идентификатор из списка областей на странице [Настройка вкладок](building-sites/client-proofing/form-customization/tabs "Настройка вкладок") или из колонки **Region (ID)** вкладки **Regions** того же набора. -| ID | Описание | -| ---------------------- | ----------------------------------------------------------- | -| modx-resource-settings | Первая вкладка, или вкладка Создать / Редактировать ресурс. | -| modx-page-settings | Вторая вкладка или вкладка «Параметры страницы». | - -Вы также можете создать вкладку с помощью правила [Новая вкладка»](building-sites/client-proofing/form-customization/rules/new-tab "Новая вкладка") и перенести туда TV. - -## Примеры - -Пример правила для перемещения TV 1 на первую вкладку на странице создания ресурса будет выглядеть так: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/rule-tvmove.png) +Колонка **Region Rank** рядом задаёт порядок переменных внутри области. ## Смотрите также -```php -[[getResources@section? &parents=`1353` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/new-tab.md b/ru/building-sites/client-proofing/form-customization/rules/new-tab.md index e6e8478e6..d24119b1c 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/new-tab.md +++ b/ru/building-sites/client-proofing/form-customization/rules/new-tab.md @@ -1,41 +1,28 @@ --- -title: "Новая вкладка" +title: "Новая область" translation: "building-sites/client-proofing/form-customization/rules/new-tab" +description: "Правило «Новая область» набора настройки формы в MODX: как оно добавляет свою область в форму." --- -Следующее относится к более старым версиям MODX. Смотрите [вкладки Настройка через настройку формы](building-sites/client-proofing/form-customization/tabs) для получения инструкций по более новым версиям MODX. +## Что делает правило -## Правило новой вкладки +Добавляет в форму менеджера область собственного сочинения. Область появляется в форме отдельной вкладкой, рядом с областями формы ресурса. -Если установлено новое правило вкладки, на панели будет создана новая вкладка. +## Где задаётся -## Использование +Вкладка **Regions** набора. Нажмите **Создать**, чтобы добавить строку в сетку, и заполните два поля: -- Укажите идентификатор этой новой вкладки в поле «Имя». -- Укажите идентификатор вкладки в поле «Содержащая панель» -- Установите правило «Новая вкладка» -- Установите название новой вкладки в поле «Значение» +- **Region (ID)** — идентификатор области, например `my-new-tab`. Он должен быть уникален в пределах набора, и именно на него вы ссылаетесь, перенося TV в область. +- **Title** — текст на вкладке. -### Доступные панели табов +Строку можно удалить снова пунктом **Delete** её контекстного меню. Удалить можно только область, созданную так; области самой формы удалить нельзя. -Вот идентификаторы для соответствующих панелей вкладок на различных страницах менеджера. +## Где появляется область -| id | Соответствующая страница | -| ------------------- | ------------------------------------------- | -| modx-resource-tabs | Страница редактирования / создания ресурса. | -| modx-chunk-tabs | Страница чанка. | -| modx-snippet-tabs | Страница сниппета. | -| modx-plugin-tabs | Страница плагинов. | -| modx-template-tabs | Страница шаблона. | -| modx-tv-tabs | Страница переменной шаблона. | -| modx-user-tabs | Страница пользователя. | -| modx-usergroup-tabs | Страница группы пользователей. | -| modx-context-tabs | Контекстная страница. | +Своя область добавляется в форму ресурса. Её нельзя добавить в форму другого элемента: страницы чанка, сниппета, пользователя или группы пользователей настройка форм не покрывает. -Панели вкладок на страницах, не относящихся к ресурсам, доступны только в версии 2.0.0-pl и выше +## Смотрите также -## Примеры - -Пример правила для создания новой вкладки на странице редактирования ресурса будет выглядеть так: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/rule-tabnew.png) +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/tab-title.md b/ru/building-sites/client-proofing/form-customization/rules/tab-title.md index 90c1a454d..3504bfbfb 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/tab-title.md +++ b/ru/building-sites/client-proofing/form-customization/rules/tab-title.md @@ -1,31 +1,21 @@ --- -title: "Название вкладки" +title: "Заголовок области" translation: "building-sites/client-proofing/form-customization/rules/tab-title" +description: "Правило «Заголовок области» набора настройки формы в MODX: как оно переименовывает область формы." --- -## Правило заголовка вкладки +## Что делает правило -Правило заголовка вкладки изменит название любой вкладки. +Заменяет заголовок области формы текстом, который задали вы. Область сохраняет своё место в форме, меняется только текст на её вкладке. -## Использование +## Где задаётся -Значения для Правила должны быть следующими: +Вкладка **Regions** набора, колонка **Title**. Область со своим заголовком получает правило; пустая ячейка оставляет штатный заголовок. -- **Имя** : идентификатор вкладки для изменения. -- **Содержащая панель** : Идентификатор вкладки для изменения. -- **Правило** : заголовок вкладки -- **Значение** : новый текст для изменения заголовка вкладки. - -Для получения списка вкладок, доступных для каждой страницы, см. [Страницы настройки формы](building-sites/client-proofing/form-customization "Страницы настройки формы") . - -## Примеры - -Пример правила изменения названия вкладки «Параметры страницы» для всех [пользователей](building-sites/client-proofing/security/users "пользователей") на «Пользовательские поля» будет выглядеть следующим образом: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-tabtitle.png) +Области формы всегда принадлежат панели ресурса. Своя область, созданная правилом [Новая область](building-sites/client-proofing/form-customization/rules/new-tab "Новая область"), получает заголовок из той же колонки. ## Смотрите также -```php -[[getResources@section? &parents=`300` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/tab-visible.md b/ru/building-sites/client-proofing/form-customization/rules/tab-visible.md index 9c06ff3ec..e8dda5670 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/tab-visible.md +++ b/ru/building-sites/client-proofing/form-customization/rules/tab-visible.md @@ -1,20 +1,19 @@ --- -title: "Видимая вкладка" +title: "Видимость области" translation: "building-sites/client-proofing/form-customization/rules/tab-visible" +description: "Правило «Видимость области» набора настройки формы в MODX: как оно прячет область формы." --- -## Правило видимой вкладки +## Что делает правило -Правило видимости вкладки, если установлено значение 0, скрывает вкладку от пользователя. +Прячет область формы менеджера. Область — это целая вкладка формы или её часть; список областей есть на странице [Настройка вкладок](building-sites/client-proofing/form-customization/tabs "Настройка вкладок"). -## Примеры +## Где задаётся -Пример правила скрытия вкладки «Параметры страницы» для всех [пользователей](building-sites/client-proofing/security/users "пользователей") будет выглядеть следующим образом: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-tabvisible.png) +Вкладка **Regions** набора, колонка **Visible**. Снятая отметка у области создаёт правило; поставленная обратно — удаляет его. ## Смотрите также -```php -[[getResources@section? &parents=`301` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/tv-default.md b/ru/building-sites/client-proofing/form-customization/rules/tv-default.md index 5b8549dfb..e15fb7fb7 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/tv-default.md +++ b/ru/building-sites/client-proofing/form-customization/rules/tv-default.md @@ -1,31 +1,24 @@ --- -title: "TV по умолчанию" +title: "Значение TV по умолчанию" translation: "building-sites/client-proofing/form-customization/rules/tv-default" +description: "Правило «Значение TV по умолчанию» набора настройки формы в MODX: как оно задаёт значение по умолчанию TV." --- -## TV по умолчанию +## Что делает правило -Правило значения по умолчанию для TV, если оно установлено, устанавливает значение по умолчанию для TV. +Задаёт значение по умолчанию для TV формы менеджера. Значение появляется, когда форма открывается. -Это работает только для действий «создать», а **не** «обновить». +Правило применяется на той странице, к которой привязан набор, — и на странице создания ресурса, и на странице редактирования. Чтобы оно действовало только при создании, привяжите набор к действию **Create Resource**, а не к **Create & Edit Resource**. -## Использование +## Где задаётся -Значения для Правила должны быть следующими: +Вкладка **Template Variables** набора, колонка **Default Value**. -- **Имя** : идентификатор TV с префиксом TV; например, для TV с идентификатором 23, «tv23» -- **Содержащая панель** : 'modx-panel-resource' -- **Правило** : «Значение ТВ по умолчанию» -- **Значение** : значение, которое вы хотите установить по умолчанию. - -## Примеры - -Пример правила установки значения по умолчанию для TV с идентификатором 23 «test»: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/fc-tvdefault.png) +**Пустая ячейка обнуляет значение** +Очищенная ячейка не возвращает исходное значение по умолчанию, а задаёт пустое. Чтобы вернуть исходное, впишите его в ячейку сами. ## Смотрите также -```php -[[getResources@section? &parents=`313` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/tv-title.md b/ru/building-sites/client-proofing/form-customization/rules/tv-title.md index 3071fac11..90b456027 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/tv-title.md +++ b/ru/building-sites/client-proofing/form-customization/rules/tv-title.md @@ -1,20 +1,19 @@ --- -title: "Название ТВ" +title: "Заголовок TV" translation: "building-sites/client-proofing/form-customization/rules/tv-title" +description: "Правило «Заголовок TV» набора настройки формы в MODX: как оно переименовывает TV формы." --- -## Заголовок TV правило +## Что делает правило -Правило заголовка TV изменит название TV. +Заменяет метку TV формы текстом, который задали вы. TV сохраняет имя и значение, меняется только текст рядом с ней. -## Примеры +## Где задаётся -Пример правила установки метки на «Boo!» для TV с идентификатором 1 для всех [пользователи](building-sites/client-proofing/security/users "пользователей") будут выглядеть так: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/rule-tvlabel.png) +Вкладка **Template Variables** набора, колонка **Label**. Переменная со своей меткой получает правило; пустая ячейка оставляет штатную метку. ## Смотрите также -```php -[[getResources@section? &parents=`314` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/rules/tv-visible.md b/ru/building-sites/client-proofing/form-customization/rules/tv-visible.md index 680bfe341..3a53e6023 100644 --- a/ru/building-sites/client-proofing/form-customization/rules/tv-visible.md +++ b/ru/building-sites/client-proofing/form-customization/rules/tv-visible.md @@ -1,20 +1,19 @@ --- -title: "TV Видимый" +title: "Видимость TV" translation: "building-sites/client-proofing/form-customization/rules/tv-visible" +description: "Правило «Видимость TV» набора настройки формы в MODX: как оно прячет TV формы." --- -## TV Видимый правила +## Что делает правило -TV Видимый правила, если установлено значение 0, будет скрывать TV от пользователя. +Прячет TV формы менеджера. TV не просто скрывается: её тип меняется на `hidden`, так что её не выводят и нельзя заполнить. -## Примеры +## Где задаётся -Пример правила сокрытия TV с идентификатором 1 для всех [пользователей](building-sites/client-proofing/security/users "пользователей") будет выглядеть так: - -![](/2.x/en/building-sites/client-proofing/form-customization/rules/rule-tvvisible.png) +Вкладка **Template Variables** набора, колонка **Visible**. Снятая отметка у переменной создаёт правило; поставленная обратно — удаляет его. ## Смотрите также -```php -[[getResources@section? &parents=`315` &context=`revolution`]] -``` +1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) +2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) +3. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) diff --git a/ru/building-sites/client-proofing/form-customization/sets.md b/ru/building-sites/client-proofing/form-customization/sets.md index 9f4c40680..580b69943 100644 --- a/ru/building-sites/client-proofing/form-customization/sets.md +++ b/ru/building-sites/client-proofing/form-customization/sets.md @@ -1,53 +1,78 @@ --- title: "Наборы настроек формы" translation: "building-sites/client-proofing/form-customization/sets" +description: "Набор настройки формы в MODX: страница, к которой он применяется, шаблон и условие, которыми он ограничен, и три сетки правил, которые он держит." --- -## Что такое набор настроек формы? +## Что такое набор настроек формы -Набор настроек формы - это набор правил, которые выполняются для конкретной страницы (действия) в диспетчере. В настоящее время наборы могут применяться к страницам создания ресурса или обновления. Думайте о них как о способе сбора всех ваших «Когда загружается страница« Создание ресурса », все эти поля меняются». правила. Наборы также могут быть помечены как «неактивные», чтобы не загружаться. +Набор настроек формы — это набор правил, которые выполняются для конкретной страницы (действия) в менеджере. Думайте о них как о способе собрать все ваши «Когда загружается страница «Правка ресурса», все эти поля меняются». Наборы также можно помечать как «неактивные», чтобы не загружать. + +Набор привязывается к одному из трёх действий: **Create Resource**, **Edit Resource** или **Create & Edit Resource**. Смотрите [Настройка менеджера](building-sites/client-proofing/form-customization "Настройка менеджера"). ### Ограничение на шаблон -Вы можете выбрать шаблон, который ограничен для загрузки набора. Если Ресурс (или в Создать ресурс, шаблон родительского элемента или параметр "default_template") имеет это в качестве своего шаблона, этот набор будет работать. Не задание шаблона предполагает, что набор должен работать для всех ресурсов. +Вы можете выбрать шаблон, которым ограничен набор. Если у ресурса (а на странице создания — у родителя или в настройке `default_template`) этот шаблон, набор будет работать. Без заданного шаблона предполагается, что набор работает для всех ресурсов. -Кроме того, установка шаблона ограничивает список переменных шаблона, которые отображаются как редактируемые, переменными шаблона, назначенными этому шаблону. +Кроме того, заданный шаблон ограничивает список редактируемых TV теми, что назначены этому шаблону. ### Использование ограничений -Ограничение может быть установлено на множестве, чтобы ограничиться определенным значением. Например, если задать для параметра Constraint поле 'parent' и значение '123', этот набор будет применяться ко всем прямым дочерним элементам родительского элемента 123. Ограничение для поля 'class_key' и значения 'modWebLink' будет применять этот набор ко всем элементам WebLink. для страницы набора. +Ограничение задаётся на наборе и привязывает его к определённому значению. Например, ограничение по полю `parent` со значением `123` применит набор ко всем прямым детям ресурса 123. Ограничение по полю `class_key` со значением `MODX\Revolution\modWebLink` применит набор ко всем веб-ссылкам на странице набора. + +Заполнять нужно **оба** поля ограничения. Если заполнено только одно, набор не сохранится. + +Значением может быть и список через запятую: тогда правило сработает при любом из перечисленных значений. + +Значение сравнивается со значением поля ресурса как есть. В поле `class_key` лежит полное имя класса вместе с пространством имён. ## Создание набора правил -Правила можно настроить в наборе с помощью сеток и вкладок на странице редактирования набора. Когда вы закончите редактирование полей, используйте кнопку «Сохранить» в правом верхнем углу, чтобы сохранить набор. +Правила настраиваются в наборе с помощью сеток на странице редактирования набора. У страницы три вкладки: **Set Information and Fields**, **Regions** и **Template Variables**. Когда закончите, нажмите «Сохранить» в правом верхнем углу. + +Смена шаблона набора перезагружает страницу и пересобирает список TV под новый шаблон. ### Регулировка полей -Поля находятся на первой вкладке на странице редактирования набора. Вы можете изменить видимость поля, метку, присвоенную полю, или значение по умолчанию. (Примечание. Изменения значений по умолчанию применяются только к страницам «Создать».) Чтобы вернуться к обычной метке или значению по умолчанию для поля, просто оставьте поле пустым. +Поля находятся на вкладке **Set Information and Fields**. Вы можете изменить видимость поля, метку, присвоенную полю, или значение по умолчанию. Чтобы вернуть обычную метку поля, просто оставьте ячейку пустой. -### Скрытие или переименование вкладок +Настраивать можно поля формы ресурса: `id`, `pagetitle`, `alias`, `longtitle`, `description`, `introtext`, `content`, `published`, `deleted`, `publishedon`, `pub_date`, `unpub_date`, `template`, `hidemenu`, `menutitle`, `link_attributes`, `menuindex`, `class_key`, `content_type`, `parent`, `content_dispo`, `isfolder`, `show_in_tree`, `hide_children_in_tree`, `alias_visible`, `uri_override`, `uri`, `richtext`, `cacheable`, `searchable`, `syncsite`. -Вкладки находятся на 2-й вкладке на странице редактирования набора. Вы можете изменить их видимость, а также их название. Вы также можете создавать новые вкладки для отображения на странице редактирования. +### Скрытие или переименование областей -При создании новой вкладки вам будут представлены поля ID и Title. Поле заголовка - это то, что будет отображаться в виде текста новой вкладки; тогда как идентификатор - это то, что используется при перемещении TV во вкладку. +Области находятся на вкладке **Regions**. Вы можете изменить их видимость, а также заголовок. Можно и создать свою область, которая появится на странице редактирования. -См. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs "Настройка вкладок с помощью настройки формы") для получения дополнительной информации. +Подробнее — на странице [Настройка вкладок](building-sites/client-proofing/form-customization/tabs "Настройка вкладок"). -### Корректировка переменных шаблона +### Корректировка TV -TVs находятся на 3-й вкладке на странице редактирования настроек. Вы можете настроить метку, значение по умолчанию, видимость или вкладку, на которой они находятся. +TV находятся на вкладке **Template Variables**. Вы можете настроить метку, значение по умолчанию, видимость и область, в которой они лежат. -Если вы хотите изменить вкладку, на которой находится TV, просто измените поле вкладки на идентификатор вкладки, на которую вы хотите переместить ее. Столбец «Ранжирование вкладок» позволяет настроить порядок, в котором TV помещается на вкладку, в отношении других TVов, перемещаемых в эту вкладку. +Чтобы изменить область TV, впишите в поле Region идентификатор нужной области. Колонка «Region Rank» задаёт порядок TV внутри области относительно других TV, переносимых туда же. + +Правила применяются в фиксированном порядке, и перенос TV идёт последним — TV можно перенести в область, которую тот же набор только что создал. Смотрите [Правила настройки формы](building-sites/client-proofing/form-customization/rules "Правила настройки формы"). ## Редактирование наборов через XML -Наборы можно экспортировать в файлы XML, щелкнув правой кнопкой мыши Набор на странице редактирования профиля. MODX экспортирует набор в файл XML и предложит вам загрузить его. Оттуда вы можете редактировать файл XML напрямую, а когда закончите, «импортировать» его обратно через кнопку в сетке «Наборы». Это может быть полезно, если вы не хотите использовать пользовательский интерфейс или хотите иметь общие наборы, которые вы используете на нескольких сайтах. +Наборы можно экспортировать в файлы XML, щёлкнув правой кнопкой мыши по набору на странице редактирования профиля. MODX экспортирует набор в файл XML и предложит его загрузить. Оттуда можно править XML напрямую, а затем «импортировать» его обратно кнопкой в сетке «Наборы». Это удобно, если вы не хотите пользоваться интерфейсом или хотите иметь общие наборы для нескольких сайтов. + +Импорт набора из XML создаст **новый** набор, а не переопределит существующие. После импорта можно деактивировать прежние наборы. + +**Правила TV через импорт не проходят** +Импортер записывает правила TV под голым идентификатором переменной, а всё, что их читает, ищет идентификатор с префиксом `tv`. Правила TV импортированного набора приходится задавать заново вручную в сетках набора. + +## API раздела + +Пакет может работать с разделом через действия коннектора. Все они требуют права `customize_forms`: -Импорт набора из XML создаст **новый** набор, а не переопределит существующие. После импорта набора из XML вы можете деактивировать любые старые наборы. +- `Security/Forms/Profile/Activate`, `ActivateMultiple`, `Create`, `Deactivate`, `DeactivateMultiple`, `Duplicate`, `GetList`, `Remove`, `RemoveMultiple`, `Update`, `UpdateFromGrid`; +- `Security/Forms/Set/Activate`, `ActivateMultiple`, `Create`, `Deactivate`, `DeactivateMultiple`, `Duplicate`, `Export`, `GetList`, `Import`, `Remove`, `RemoveMultiple`, `Update`, `UpdateFromGrid`. ## Смотрите также -1. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) -2. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) - 1. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs) -3. [Шаблоны и темы менеджера](building-sites/client-proofing/custom-manager-themes) +1. [Настройка менеджера](building-sites/client-proofing/form-customization) +2. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) +3. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) + 1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) + 2. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) +4. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) diff --git a/ru/building-sites/client-proofing/form-customization/tabs.md b/ru/building-sites/client-proofing/form-customization/tabs.md index 481e17a1f..b60b25702 100644 --- a/ru/building-sites/client-proofing/form-customization/tabs.md +++ b/ru/building-sites/client-proofing/form-customization/tabs.md @@ -1,41 +1,55 @@ --- title: "Настройка вкладок" translation: "building-sites/client-proofing/form-customization/tabs" +description: "Области формы ресурса в MODX, которые настройка форм может спрятать или переименовать, и как добавить свою область." --- -Когда вы используете настройку форм для настройки форм в менеджере MODX, вы можете либо разрешить / запретить доступ к определенным полям, либо разрешить / запретить доступ ко всем вкладкам или *частям* вкладок. +Настройка форм прячет или переименовывает вкладки формы ресурса целиком и их части. -**Если вкладка не является вкладкой** При настройке правил настройки формы в разделе « **Безопасность» -> «Настройка формы»** , а затем при редактировании набора поведения существует список «вкладок», но этот список не соответствует непосредственно знакомому «документу». , «Настройки», «Переменные шаблона» и «Группы ресурсов». Скорее, идентификаторы вкладок, перечисленные здесь, относятся ко всем вкладкам или *частям* вкладок. +**Если область не вкладка** +В **Админ → Настройка форм** при правке набора есть список «Областей». Он не совпадает со вкладками «Документ», «Настройки», «Переменные шаблона» и «Ресурсные группы». Идентификаторы в списке относятся ко вкладке целиком или к *части* вкладки. -## Tab Regions +## Области формы Это различные области вкладок, видимость которых можно переключать. -| ID | Название вкладки по умолчанию | Описание | -| ---------------------------------- | ----------------------------- | ---------------- | -| modx-resource-settings | Документ | Основная вкладка | -| modx-resource-main-left | | -| modx-resource-main-right | | -| modx-page-settings | настройки | Основная вкладка | -| modx-page-settings-left | | -| modx-page-settings-right | | -| modx-page-settings-right-box-left | | -| modx-page-settings-right-box-right | | -| modx-panel-resource-tv | Переменные шаблона | Основная вкладка | -| modx-resource-access-permissions | Ресурсные группы | Основная вкладка | +| ID | Заголовок области по умолчанию | Описание | +| --- | --- | --- | +| modx-resource-settings | Документ | Основная вкладка | +| modx-resource-main-left | | | +| modx-resource-content-above | | | +| modx-resource-content-below | | | +| modx-resource-main-right | | | +| modx-resource-main-right-top | | | +| modx-resource-main-right-middle | | | +| modx-resource-main-right-bottom | | | +| modx-page-settings | Настройки | Основная вкладка | +| modx-page-settings-left | | | +| modx-page-settings-right | | | +| modx-page-settings-box-left | | | +| modx-page-settings-box-right | | | +| modx-panel-resource-tv | Переменные шаблона | Основная вкладка | +| modx-resource-access-permissions | Ресурсные группы | Основная вкладка | + +Набор, привязанный к действию **Create Resource**, предлагает на две области меньше: `modx-resource-content-above` и `modx-resource-content-below`. + +Список областей хранится в справочнике и заполняется при установке MODX. На базе, обновлённой с 2.x, список может быть короче. ## Добавление новых вкладок -Добавить новую вкладку довольно просто. Отредактируйте свой Набор и откройте вкладку Регионы. Нажмите кнопку «Создать новую вкладку», присвойте ей идентификатор, например «my-new-tab», и описание. +Отредактируйте набор и откройте вкладку **Regions**. Нажмите **Создать**, задайте области идентификатор, например `my-new-tab`, и **Title**. -![](/2.x/en/building-sites/client-proofing/form-customization/fc_new_tab.jpg) +![](fc_new_tab.jpg) -Каждый раз, когда вам нужно обратиться к области вкладки, например, при перемещении переменных шаблона на новую вкладку, используйте идентификатор, который вы ей дали. +Каждый раз, когда вам нужно обратиться к области, например при переносе TV на новую вкладку, используйте идентификатор, который вы ей дали. + +Идентификатор должен быть уникален в пределах набора. Область, созданная так, снова удаляется пунктом **Delete** её контекстного меню. Области самой формы удалить нельзя. ## Смотрите также -1. [Настройка менеджера с помощью плагинов](_legacy/administering-your-site/customizing-the-manager-via-plugins) +1. [Настройка менеджера](building-sites/client-proofing/form-customization) 2. [Профили настройки формы](building-sites/client-proofing/form-customization/profiles) 3. [Наборы настроек формы](building-sites/client-proofing/form-customization/sets) - 1. [Настройка вкладок с помощью настройки формы](building-sites/client-proofing/form-customization/tabs) -4. [Шаблоны и темы менеджера](building-sites/client-proofing/custom-manager-themes) + 1. [Правила настройки формы](building-sites/client-proofing/form-customization/rules) + 2. [Настройка вкладок](building-sites/client-proofing/form-customization/tabs) +4. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) diff --git a/ru/building-sites/client-proofing/index.md b/ru/building-sites/client-proofing/index.md index 2bef54f9c..54cec2aaa 100644 --- a/ru/building-sites/client-proofing/index.md +++ b/ru/building-sites/client-proofing/index.md @@ -1,8 +1,34 @@ --- title: "Настройка системы управления для клиента" translation: "building-sites/client-proofing" +description: "Упростить менеджер MODX для клиента: вид менеджера и страницы входа, дашборды, формы менеджера и права доступа к нему." --- -Система управления MODX - это очень мощный административный интерфейс, и когда вы создаете сайт для клиента, скорее всего, вы захотите немного упростить административный интерфейс для него. +Система управления MODX — это очень мощный административный интерфейс, и когда вы создаёте сайт для клиента, скорее всего, захотите немного его притихнуть. -Для этого есть несколько инструментов. \ No newline at end of file +## Вид менеджера + +- [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) — переопределить файлы менеджера своей темой. +- [Настройка входа в Менеджер](building-sites/client-proofing/manager-login) — логотип, фон, блок справки и язык страницы входа. +- Настройка `manager_logo` ставит ваш логотип в левую панель менеджера. + +## Дашборды + +[Дашборды](building-sites/client-proofing/dashboards) — виджеты на странице, которую видит пользователь после входа, и кто какие видит. + +## Формы менеджера + +[Настройка форм](building-sites/client-proofing/form-customization) — профили, которые скрывают поля, переименовывают вкладки и меняют значения, и наборы правил, которые в них входят. + +## Доступ к менеджеру + +[Безопасность](building-sites/client-proofing/security) — политики, права, группы пользователей, роли и группы ресурсов, которые определяют, что может делать пользователь. + +## Смотрите также + +1. [Настройка системы управления для клиента](building-sites/client-proofing) +2. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) +3. [Настройка входа в Менеджер](building-sites/client-proofing/manager-login) +4. [Дашборды](building-sites/client-proofing/dashboards) +5. [Настройка форм](building-sites/client-proofing/form-customization) +6. [Безопасность (ACL)](building-sites/client-proofing/security) diff --git a/ru/building-sites/client-proofing/manager-login.md b/ru/building-sites/client-proofing/manager-login.md index 80ca1718f..059302f62 100644 --- a/ru/building-sites/client-proofing/manager-login.md +++ b/ru/building-sites/client-proofing/manager-login.md @@ -1,29 +1,38 @@ --- title: Настройка входа в Менеджер translation: "building-sites/client-proofing/manager-login" +description: "Страница входа в менеджер MODX: логотип, фоновое изображение, блок справки, язык и настройки, которые их меняют." --- -В MODX 3 внешний вид страницы входа в Менеджер настраивается проще. +У страницы входа в MODX 3 свои настройки, свой шаблон и свои события. Внешний вид можно сменить, не трогая остальной менеджер. ## Логотип -По умолчанию используется логотип MODX из `/manager/templates/default/images/modx-logo-color.svg`. +По умолчанию используется логотип сайта из `/manager/templates/default/images/modx-logo-color.svg`. -Чтобы поставить другой логотип, укажите URL изображения в системной настройке `login_logo`. Подойдёт локальный файл или полный внешний URL. Ширина ограничена 192 пикселями (или 384 на дисплеях 2x). +Чтобы поставить другой логотип, укажите URL изображения в системной настройке `login_logo`. Подойдёт локальный файл или полный внешний URL. Ширина ограничена 192 CSS-пикселями. + +Логотип используется и в письмах менеджера, в стандартном шаблоне `email/default.tpl`. + +**Своей теме нужен свой логотип** +Логотип по умолчанию читается из каталога темы, без отката на `default`. В теме без `images/modx-logo-color.svg` на странице входа будет битый логотип. + +Favicon страницы задаётся отдельно, настройкой `manager_favicon_url`. ## Фоновое изображение -Фон страницы входа по умолчанию лежит в `/manager/templates/default/images/login/default-background.jpg`. Фото в MODX 3.0.0 снял Christian Seel: горный хребет у Engelberg, Швейцария. Новый экран входа собирали там на SnowUp. ([Источник](https://github.com/modxcms/revolution/pull/13773#issuecomment-364594061)) +Фон страницы входа по умолчанию лежит в `/manager/templates/default/images/login/default-background.jpg`. Фото в MODX 3.0.0 снял Christian Seel ([источник](https://github.com/modxcms/revolution/pull/13773#issuecomment-364594061)). -> Если вы используете кастомную тему Менеджера, добавьте и файл `/manager/templates/YOUR-THEME/images/login/default-background.jpg` как фон по умолчанию. +Чтобы сменить фон, укажите адрес изображения в системной настройке `login_background_image`. Подойдёт локальный файл или полный внешний URL. Лучше работает горизонтальное изображение. -Чтобы сменить фон, укажите URL в системной настройке `login_background_image`. Подойдёт локальный файл или полный внешний URL. Лучше работает landscape-изображение. +> [!NOTE] +> Если вы используете свою тему менеджера, добавьте и файл `/manager/templates/YOUR-THEME/images/login/default-background.jpg` как фон по умолчанию. ### Смена из кода -Фон можно менять и плагином. +Фон можно задать и плагином. Так каждому посетителю достаётся своя картинка. -Готовый пример: Extra [DailyPhoto](https://modx.com/extras/package/dailyphoto) каждый день подставляет случайное фото с Unsplash. +Готовый пример: дополнение [DailyPhoto](https://modx.com/extras/package/dailyphoto). Каждый день оно подставляет случайное фото с Unsplash. Свою логику сделайте плагином на событие `OnManagerLoginFormRender`: @@ -31,12 +40,47 @@ translation: "building-sites/client-proofing/manager-login" $modx->controller->setPlaceholder('background', '/full/url/to/image.jpg'); ``` +Событие `OnManagerLoginFormPrerender` вставляет свой вывод перед формой. Плагин на этом событии не задаёт фон: тема записывает плейсхолдер уже после Prerender. + ## Блок справки -На странице входа есть блок помощи, но по умолчанию он выключен. Включите системную настройку `login_help_button`. Внизу панели входа появится ссылка Help. +На странице входа есть блок помощи. По умолчанию он выключен. Включите системную настройку `login_help_button`, и внизу панели входа появится ссылка Help. + +Текст блока лежит в лексиконе. Откройте **Админ → Управление словарями**. Namespace: `core`, topic: `login`, нужный язык. Ключи: `login_help_button_text`, `login_help_text`, `login_help_title`. Правьте значение двойным кликом. + +Текст приветствия выбирается по времени суток из ключей `login_greeting_morning`, `login_greeting_afternoon`, `login_greeting_evening` и `login_greeting_night` той же темы. + +## Язык -Текст блока лежит в лексиконе. Откройте **Система → Лексиконы**. Namespace: `core`, topic: `login`, нужный язык. Ключи: `login_help_button_text`, `login_help_text`, `login_help_title`. Правьте значение двойным кликом. +Язык страницы входа выбирается прямо на ней. Это не настройка `manager_language`. В MODX 3 такую настройку удаляют при обновлении, а язык живёт в сессии. + +Страница берёт первый источник, в котором язык есть: + +| Порядок | Источник | +| --- | --- | +| 1 | Запрос | +| 2 | Сессия | +| 3 | Браузер | +| 4 | `en` | + +## Другие настройки + +| Настройка | Что меняет | +| --- | --- | +| `allow_manager_login_forgot_password` | Показывать ли блок сброса забытого пароля. | +| `manager_login_url_alternate` | Адрес, куда отправляется неавторизованный пользователь, вместо страницы входа. | +| `manager_direction` | Направление текста, `rtl` для языка справа налево. | +| `compress_css` | Подключать ли на странице входа минифицированный стиль. | +| `password_min_length` | Минимальная длина пароля, в подсказке под полем. | +| `session_cookie_lifetime` | Время жизни сессии, в подписи к чекбоксу «запомнить меня». | ## Вход без пароля -При необходимости включите [вход по magic link](building-sites/client-proofing/security/passwordless-login) вместо логина и пароля. +Вместо имени и пароля страница может предложить [вход по волшебной ссылке](building-sites/client-proofing/security/passwordless-login). С настройкой `passwordless_activated` форма показывает только поле для адреса почты. Срок действия ссылки задаёт настройка `passwordless_expiration`, по умолчанию 3600 секунд. + +## Смотрите также + +1. [Настройка системы управления для клиента](building-sites/client-proofing) +2. [Пользовательские темы системы управления](building-sites/client-proofing/custom-manager-themes) +3. [Настройка входа в Менеджер](building-sites/client-proofing/manager-login) +4. [Вход без пароля](building-sites/client-proofing/security/passwordless-login) diff --git a/ru/building-sites/client-proofing/security/drag-resource-into-group1.png b/ru/building-sites/client-proofing/security/drag-resource-into-group1.png new file mode 100644 index 000000000..deb1a5e00 Binary files /dev/null and b/ru/building-sites/client-proofing/security/drag-resource-into-group1.png differ diff --git a/ru/building-sites/client-proofing/security/index.md b/ru/building-sites/client-proofing/security/index.md index 69735636f..fb2651a41 100644 --- a/ru/building-sites/client-proofing/security/index.md +++ b/ru/building-sites/client-proofing/security/index.md @@ -1,38 +1,105 @@ --- title: "Безопасность (ACLs)" translation: "building-sites/client-proofing/security" +description: "Модель безопасности MODX: группы, политики и разрешения, и как список контроля доступа их связывает." --- -## Безопасность в MODX Revolution +## Модель безопасности -Безопасность в MODX Revolution строится на Attribute-Based Access Control (ABAC). +Безопасность в MODX Revolution построена на списках. Права выдаются группам пользователей и привязываются к объекту с указанием минимальной роли. -У каждого пользователя есть объект [User](building-sites/client-proofing/security/users). Его можно включить в любое число [User Groups](building-sites/client-proofing/security/user-groups). Группам задают атрибуты через [Access Control Lists](building-sites/client-proofing/security/policies/acls) (ACL). Названия ACL зависят от того, куда их применяют, но принцип один: в списке лежат [Permissions](building-sites/client-proofing/security/policies/permissions). Эти разрешения открывают доступ к разделам и действиям в MODX. +Каждый пользователь в MODX — это объект [User](building-sites/client-proofing/security/users "Пользователи"), который может состоять в любом числе [групп пользователей](building-sites/client-proofing/security/user-groups "Группы пользователей"). Каждой группе пользователей назначаются атрибуты через [списки контроля доступа](building-sites/client-proofing/security/policies/acls "ACL") (ACL). У этих ACL разные названия в зависимости от того, к чему они применены, но у всех есть одно общее свойство — они содержат список [разрешений](building-sites/client-proofing/security/policies/permissions "Разрешения"). Эти разрешения открывают доступ к разным разделам и действиям MODX. -Обычно у ACL есть: +У ACL обычно есть следующее: -- **Principal**: кто получает права. По умолчанию это User Group. -- **Target**: к чему применяется ACL, например Context или Resource Group. -- **Access Policy**: список Permissions по этой ACL. -- **Authority**: минимальный уровень полномочий для использования ACL (см. [Roles](building-sites/client-proofing/security/roles)). +- **Principal** — объект, получающий права доступа. В MODX по умолчанию это группа пользователей. +- **Target** — объект, к которому они применяются, например контекст или группа ресурсов. +- **Access Policy** — список разрешений, которые даёт этот ACL. +- **Authority** — минимальный уровень authority, нужный для использования этого ACL (см. [Роли](building-sites/client-proofing/security/roles "Роли")). -В MODX доступ **allow/deny**: по умолчанию всё открыто. После назначения ACL на объект (Context или Resource Group) туда попадают только те, у кого есть нужные Permissions. +Проверку ACL пользователь проходит, когда authority его роли **не больше** authority самого ACL: политики выдаются группе, а роль — это просто число, с которым сравнивается порог. -### Видео-туториал по безопасности +Доступ в MODX **по разрешению**: по умолчанию он открыт. Как только к объекту — контексту или группе ресурсов — применён ACL, этот объект доступен только тем, у кого есть подходящие разрешения. -На Sample Site MODX показано, как: +### Права страницы -- ограничить RSS для Directors и выше -- ограничить Blog только для Staff -- сделать «secure» Context только для Directors и выше -- ограничить часть категорий элементов только для администраторов +Странице списков контроля доступа нужно право `access_permissions`. + +## Что создаётся при установке + +MODX 3 создаёт при установке: + +| Кто | Что | +| --- | --- | +| Анонимный пользователь | Политика **Load Only** на контексте `web`, с authority 9999. | +| Группа `Administrator` | Политика **Administrator** на контекстах `web` и `mgr`, с authority 0 — это роль Super User. | + +Анонимный пользователь — не группа: это ACL с principal `0`. Группы «Anonymous» в базе нет, а в дереве групп он показан как псевдоузел «(Anonymous)». + +Роль **Member** имеет authority 9999, поэтому она не проходит проверку ACL с authority 0. Роль **Super User** проходит. + +## Видеоурок по безопасности + +Демонстрирует применение понятий на тестовом сайте MODX: + +- Ограничить RSS-ленту для директоров и выше +- Ограничить блог только для сотрудников +- Создать защищённый контекст для директоров и выше +- Ограничить некоторые категории элементов администраторами ![](understanding-revo-acls.jpg) -### Пример: доступ к Context +### Пример: доступ к контексту -Создайте Context `test` и назначьте ему ACL. Откройте Context, вкладка **Access Permissions**. Дайте группе (например `HR Dept`) явный доступ: выберите User Group, политику `Administrator` и нужный Authority (например `9999` для Member): +Хороший пример — создать контекст 'test' и назначить ему ACL. Это делается в форме контекста, на вкладке 'Access Permissions'. Там можно дать группе пользователей (например, 'HR Dept') явный доступ к этому контексту: выбрать группу, политику 'Administrator' и указать требуемый Authority (например, 9999 для 'Member'): ![](sec-ugctx1.png) -Context `test` станет доступен пользователям, которые в группе `HR Dept` с ролью Member или с более сильным [Authority](building-sites/client-proofing/security/roles). +Это ограничит контекст 'test' пользователями, которые являются Member (или имеют [роль](building-sites/client-proofing/security/roles "Роли") с большим authority) группы 'HR Dept'. + +## События + +Поведение аутентификации и учётных записей меняется плагином. События раздела: + +| Событие | Когда срабатывает | +| --- | --- | +| OnManagerLogin, OnWebLogin | После того, как пользователь вошёл. | +| OnManagerAuthentication, OnWebAuthentication | Пока проверяются данные пользователя. | +| OnUserNotFound | Когда вход называет несуществующего пользователя. | +| OnManagerLogout, OnWebLogout | После того, как пользователь вышел. | +| OnBeforeManagerLogout, OnBeforeWebLogout | Перед выходом пользователя. | +| OnUserBeforeSave, OnUserSave | До и после сохранения пользователя. | +| OnUserBeforeRemove, OnUserRemove | До и после удаления пользователя. | +| OnUserFormSave, OnBeforeUserFormSave | До и после сохранения пользователя из формы менеджера. | +| OnUserChangePassword | После того, как пользователь сменил пароль. | +| OnUserActivate, OnBeforeUserActivate | После и до активации пользователя. | +| OnUserDeactivate, OnBeforeUserDeactivate | После и до деактивации пользователя. | +| OnUserBeforeAddToGroup, OnUserAddToGroup | До и после добавления пользователя в группу. | +| OnUserBeforeRemoveFromGroup, OnUserRemoveFromGroup | До и после удаления пользователя из группы. | +| OnUserGroupBeforeSave, OnUserGroupSave | До и после сохранения группы. | +| OnUserGroupBeforeRemove, OnUserGroupRemove | До и после удаления группы. | +| OnResourceGroupBeforeSave, OnResourceGroupSave | До и после сохранения группы ресурсов. | +| OnBeforeResourceGroupRemove, OnResourceGroupRemove | До и после удаления группы ресурсов. | +| OnResourceAddToResourceGroup, OnResourceRemoveFromResourceGroup | Когда ресурс добавляют в группу ресурсов или убирают из неё. | + +## Смотрите также + +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/passwordless-login/index.md b/ru/building-sites/client-proofing/security/passwordless-login/index.md index 24889a8d1..b6c151798 100644 --- a/ru/building-sites/client-proofing/security/passwordless-login/index.md +++ b/ru/building-sites/client-proofing/security/passwordless-login/index.md @@ -2,6 +2,7 @@ title: "Вход без пароля" translation: "building-sites/client-proofing/security/passwordless-login" sortorder: 0 +description: "Вход в MODX по волшебной ссылке вместо пароля: как включить, сколько живёт ссылка и что при этом не меняется." --- MODX3 имеет новую функцию под названием "Вход без пароля", которая может быть активирована с помощью системных настроек. После активации этой функции вам больше не нужно вводить пароль и имя пользователя для входа. Вместо этого вы просто вводите адрес электронной почты своей учетной записи, и система отправит вам электронное письмо со ссылкой для одноразового входа. Нажав на эту ссылку, вы сразу же войдете в менеджер. @@ -10,7 +11,11 @@ MODX3 имеет новую функцию под названием "Вход Потребность в надежном пароле часто заставляет людей выбирать универсальные псевдозащищенные пароли, повторно используя проверенную надежную фразу и, возможно, просто добавляя число к услуге. Как администратор сайта, вы не должны поощрять своих пользователей делать небезопасные вещи. Это устраняет риск незащищенного пароля от вашей установки MODX, но, конечно, для ваших пользователей нужна защищенная учетная запись электронной почты. Но это также относится и к традиционному входу в систему по имени пользователя и паролю, потому что здесь также есть самообслуживание паролем, где вы можете сбросить пароль по электронной почте. -Кроме того, если вход без пароля включен, пароли больше не сохраняются в базе данных MODX. Тогда больше не будет теоретического риска кражи паролей в результате взлома базы данных (независимо от любого шифрования). +Выигрыш в том, что пользователю не нужно придумывать, запоминать и переиспользовать пароль. + +## Пароль заменяется + +Вход по ссылке заменяет пароль пользователя. Обработчик записывает сгенерированный пароль в поле `password`, где хранится только его хеш, и входит с ним. Поэтому пароль, который выбрал пользователь, после первой ссылки пропадает — у учётной записи остаётся пароль, которого никто не знает. ## Как включить пароль без логина @@ -26,6 +31,32 @@ MODX3 имеет новую функцию под названием "Вход Вы можете настроить срок действия ссылки для входа в систему через системный параметр `passwordless_expiration`. По умолчанию оно установлено на 3600 секунд, что должно быть достаточно для всех, чтобы войти в систему. Если вы параноик, вы можете легко установить на более низкое значение, например, 600 разрешить использование ссылки только на 10 минут. Срок действия также будет указан в самом электронном письме. -## Дополнительные замечания +## Ссылка работает один раз + +Ссылка работает только один раз: запись удаляется из реестра, как только её использовали. Токен ссылки подписан хешем пароля пользователя, поэтому ссылка перестаёт работать, как только пароль сменился. + +## Дополнительные примечания Имейте в виду, что _не будет сообщения об ошибке_, если вы введете неизвестный адрес электронной почты во время входа в систему. Это хорошо известное и предполагаемое поведение для предотвращения попыток перечисления пользователей. + +## Смотрите также + +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/acl-ecat1.png b/ru/building-sites/client-proofing/security/policies/acl-ecat1.png new file mode 100644 index 000000000..b6cede2e1 Binary files /dev/null and b/ru/building-sites/client-proofing/security/policies/acl-ecat1.png differ diff --git a/ru/building-sites/client-proofing/security/policies/acl-rg1.png b/ru/building-sites/client-proofing/security/policies/acl-rg1.png new file mode 100644 index 000000000..0d3fa8342 Binary files /dev/null and b/ru/building-sites/client-proofing/security/policies/acl-rg1.png differ diff --git a/ru/building-sites/client-proofing/security/policies/acls.md b/ru/building-sites/client-proofing/security/policies/acls.md index 78daf86d9..3a4eeb5d2 100644 --- a/ru/building-sites/client-proofing/security/policies/acls.md +++ b/ru/building-sites/client-proofing/security/policies/acls.md @@ -1,6 +1,7 @@ --- title: "ACL (Список контроля доступа)" translation: "building-sites/client-proofing/security/policies/acls" +description: "Списки контроля доступа MODX: пять видов ACL, что группа получает с одним из них и как сравнивается роль." --- ## Что такое ACL (список контроля доступа)? @@ -9,7 +10,17 @@ ACL, или список контроля доступа (Access Control List), ## Использование -В MODX ACL можно применить к любому modAccessibleObject. В первую очередь MODX Revolution 2.0 позволяет использовать ACL для ресурсов и контекстов. +В MODX 3 есть пять видов ACL. Каждый задаётся на своей вкладке группы пользователей: + +| Вид | Что ограничивает | +| --- | --- | +| Context ACL | Доступ к контексту. | +| Resource Group ACL | Доступ к ресурсам группы ресурсов. | +| Element Category ACL | Доступ к элементам категории и к полям ресурса. | +| Media Source ACL | Доступ к файлам медиа-источника. | +| Namespace ACL | Доступ к элементам пространства имён. | + +Первые два описаны ниже. ### ACL контекста @@ -60,22 +71,22 @@ ACL для ресурсов работают немного иначе и в о ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Предоставление доступа менеджеру пользователей](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) - 2. [Создание страниц только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Создание второго суперадминистратора](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение доступа пользователей к элементу](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе анонимных пользователей](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Защита MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем с безопасностью](building-sites/client-proofing/security/troubleshooting-security) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/index.md b/ru/building-sites/client-proofing/security/policies/index.md index 7e76147bc..56349f9c8 100644 --- a/ru/building-sites/client-proofing/security/policies/index.md +++ b/ru/building-sites/client-proofing/security/policies/index.md @@ -1,25 +1,35 @@ --- title: "Политики" translation: "building-sites/client-proofing/security/policies" +description: "Политики доступа MODX: двенадцать штатных и шаблон, который определяет, что может содержать политика." --- ## Что такое политика доступа? Политика доступа - это набор [Разрешений](building-sites/client-proofing/security/policies/permissions "Разрешения") содержащий одно или несколько Разрешений, определённых в панели управления. По умолчанию в MODX определены следующие политики доступа: -- **Administrator**: Политика администрирования контекста со всеми разрешениями по умолчанию. -- **Content Editor**: Политика администрирования контекста с ограниченными разрешениями, относящимися к редактированию контента, но без разрешений на публикацию (`publish_document` / `unpublish_document`). -- **Context**: Стандартная политика контекста, которую можно применять при создании списков ACL для получения базового доступа в контексте (read/write и view\_unpublished). -- **Element**: Политика элемента MODX со всеми атрибутами. -- **Load Only**: Минимальная политика с разрешением на загрузку объекта. -- **Load, List and View**: Разрешает загрузку чтение и просмотри. -- **Media Source Admin**: Политика администрирования медиа источника. -- **Media Source User**: Политика пользователя медиа источника, с базовым просмотром и использованием - но без редактирования. -- **Object**: Политика объекта со всеми разрешениями. -- **Resource**: Политика ресурсов MODX со всеми атрибутами. +| Политика | Что это | Шаблон политики | +| --- | --- | --- | +| Administrator | Политика администрирования контекста со всеми разрешениями по умолчанию. | AdministratorTemplate | +| Content Editor | Политика администрирования контекста с ограниченными разрешениями, относящимися к редактированию контента, но без разрешений на публикацию (`publish_document` / `unpublish_document`). | AdministratorTemplate | +| Context | Стандартная политика контекста, которую можно применять при создании списков ACL для получения базового доступа в контексте (read/write и view\_unpublished). | ContextTemplate | +| Developer | Политика администрирования контекста со всеми разрешениями администратора, кроме административных и относящихся к безопасности. | AdministratorTemplate | +| Element | Политика элемента MODX со всеми атрибутами. | ElementTemplate | +| Hidden Namespace | Прячет пространство имён из списков. Даёт `load` и `view`, запрещает `list`. | NamespaceTemplate | +| Load Only | Минимальная политика с разрешением на загрузку объекта. | ObjectTemplate | +| Load, List and View | Разрешает загрузку, чтение и просмотр. | ObjectTemplate | +| Media Source Admin | Политика администрирования медиа источника. | MediaSourceTemplate | +| Media Source User | Политика пользователя медиа источника, с базовым просмотром и использованием - но без редактирования. | MediaSourceTemplate | +| Object | Политика объекта со всеми разрешениями. | ObjectTemplate | +| Resource | Политика ресурсов MODX со всеми атрибутами. | ResourceTemplate | -Если вы настраиваете любую из вышеуказанных политик доступа по умолчанию, продублируйте и переименуйте их перед настройкой! -Если вы этого не сделаете, при обновлении версии MODX все настройки будут утеряны, поскольку они будут переопределены сценарием установки. +Шаблон политики определяет, какие разрешения она вообще может содержать, — это список чекбоксов, который вы получаете при создании политики. Смотрите [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates "Шаблоны политик"). + +Если вы настраиваете любую из вышеуказанных политик доступа по умолчанию, продублируйте и переименуйте их перед настройкой! Сценарий установки пересоздаёт штатные политики при каждом обновлении, поэтому ваши правки в них могут пропасть. + +## Права страницы + +Странице политик нужно право `policy_view` — увидеть список, `policy_new` и `policy_save` — создать политику, `policy_edit` — изменить, `policy_delete` — удалить. Для шаблонов нужны `policy_template_view`, `policy_template_new`, `policy_template_save`, `policy_template_edit` и `policy_template_delete`. ## Создание и редактирование @@ -73,23 +83,22 @@ translation: "building-sites/client-proofing/security/policies" ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы Ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) - 1. [Права Доступа](building-sites/client-proofing/security/policies/permissions) - 1. [Права Доступа - Политика Администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Права Доступа - Политика Ресурса](building-sites/client-proofing/security/policies/permissions/resource-policy) - 2. [КД](building-sites/client-proofing/security/policies/acls) - 3. [Шаблоны Политик](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Предоставление доступа "User Manager"](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) - 2. [Создание "Member-Only" страниц](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Создание второго "Super Admin" пользователя](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Элементов от пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе анонимных пользователей](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Закалка MODX Revolution](getting-started/maintenance/securing-modx) -8. [Стандарты безопасности](administering-your-site/security/security-standards) -9. [Поиск проблем в безопасности](building-sites/client-proofing/security/troubleshooting-security) - 1. [Сбрость пароля пользователя в ручную](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/permissions/administrator-policy.md b/ru/building-sites/client-proofing/security/policies/permissions/administrator-policy.md index be6ce3d10..425db424f 100644 --- a/ru/building-sites/client-proofing/security/policies/permissions/administrator-policy.md +++ b/ru/building-sites/client-proofing/security/policies/permissions/administrator-policy.md @@ -1,6 +1,7 @@ --- title: "Политика Администратора" translation: "building-sites/client-proofing/security/policies/permissions/administrator-policy" +description: "Политика администратора MODX и полный список её разрешений." --- ## Политика Администратора @@ -9,119 +10,216 @@ translation: "building-sites/client-proofing/security/policies/permissions/admin ## Разрешения по умолчанию -| название | Описание доступа | -| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| about | О странице. | -| access_permissions | Любые связанные с разрешением доступа страницы и действия. | -| action_ok | -| actions | Страница [действий](extending-modx/menus/actions "Действия и меню") . | -| change_password | Пользователь может изменить свой пароль пользователя. | -| change_profile | Пользователь может изменить свой профиль. | -| Content_Types | Страница [типов контента](building-sites/resources/content-types "Типы контента") . | -| create | Базовый «создать» доступ к объектам. | -| credits | Просмотрите страницу «Кредиты». | -| customize_forms | Просмотр и управление [настройкой](building-sites/client-proofing/form-customization "Настройка менеджера") страницы [менеджера](building-sites/client-proofing/form-customization "Настройка менеджера") . | -| database | Страница Информация о системе | -| database_truncate | Возможность усекать таблицу базы данных. | -| delete_category | Удалить или удалить любые Категории. | -| delete_chunk | Удалить или удалить любые [чанки](building-sites/elements/chunks "Куски") . | -| delete_context | Удалить или удалить любые [контексты](building-sites/contexts "Контексты") . | -| delete_document | Удалить или удалить любые [Ресурсы](building-sites/resources "Ресурсы") . | -| delete_eventlog | Очистить журнал событий. | -| delete_plugin | Удалить или удалить любые [плагины](extending-modx/plugins "Плагины") . | -| delete_snippet | Удалить или удалить любые [сниппеты](extending-modx/snippets "обрывки") . | -| delete_template | Удалить или удалить любые [шаблоны](building-sites/elements/templates "Шаблоны") . | -| delete_tv | Удалить или удалить любые [переменные шаблона](building-sites/elements/template-variables "Переменные шаблона") . | -| delete_role | Удалить или удалить любые [роли](building-sites/client-proofing/security/roles "Роли") . | -| delete_user | Удалить или удалить любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | -| edit_category | Для редактирования любых категорий. | -| edit_chunk | Для редактирования любых [чанков](building-sites/elements/chunks "Куски") . | -| edit_context | Для редактирования любых [контекстов](building-sites/contexts "Контексты") . | -| edit_document | Для редактирования любых [ресурсов](building-sites/resources "Ресурсы") . | -| edit_locked | Позволяет пользователю отменять блокировку и редактировать заблокированный ресурс. | -| edit_parser | -| edit_plugin | Для редактирования любых [плагинов](extending-modx/plugins "Плагины") . | -| edit_role | Редактировать любые [роли](building-sites/client-proofing/security/roles "Роли") . | -| edit_snippet | Для редактирования любых [сниппетов](extending-modx/snippets "обрывки") . | -| edit_template | Для редактирования любых [шаблонов](building-sites/elements/templates "Шаблоны") . | -| edit_tv | Для редактирования любых [переменных шаблона](building-sites/elements/template-variables "Переменные шаблона") . | -| edit_user | Для редактирования любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | -| element_tree | Возможность просмотра дерева элементов на левой панели. | -| empty_cache | Очистить кеш сайта. | -| export_static | Для экспорта сайта в статический HTML. | -| file_manager | Использовать файловый менеджер, в том числе создание / удаление файлов. | -| file_tree | Для просмотра дерева файлов на левой панели. | -| flush_sessions | Может сбрасывать сеансы по всему сайту. | -| frames | Чтобы использовать интерфейс диспетчера MODX на всех. | -| help | Для просмотра страницы справки. | -| home | Для просмотра страницы приветствия. | -| import_static | Для просмотра или использования страниц импорта. | -| languages | Редактировать или просматривать лексикон Языки. | -| lexicons | Для редактирования или просмотра лексиконов и [интернационализации](extending-modx/internationalization "интернационализация") . | -| list | Базовое разрешение «перечислить» любой объект. Список означает получить коллекцию объектов. | -| load | Базовое разрешение «загрузить» любой объект или иметь возможность вернуть его как экземпляр вообще. | -| logout | Чтобы можно было выйти из системы как пользователь. | -| logs | Для просмотра журналов, таких как ошибки и журналы менеджера. | -| menus | Для редактирования или сохранения любых топовых пунктов меню. | -| messages | Для отправки или просмотра любых личных сообщений. | -| namespaces | Для редактирования или просмотра [пространств имен](extending-modx/namespaces "Пространства имен") . | -| new_category | Создать новую категорию. | -| new_chunk | Создать новый [чанк](building-sites/elements/chunks "Куски") . | -| new_context | Создать новый [контекст](building-sites/contexts "Контексты") . | -| new_document | Для создания новых [ресурсов](building-sites/resources "Ресурсы") . | -| new_document_in_root | Создавать [ресурс](building-sites/resources "Ресурсы") в корне сайта. Заменяет удалённую настройку `udperms_allowroot`. | -| new_plugin | Создать новый [плагин](extending-modx/plugins "Плагины") . | -| new_role | Создать новую [роль](building-sites/client-proofing/security/roles "Роли") . | -| new_snippet | Создать новый [сниппет](extending-modx/snippets "обрывки") . | -| new_template | Создать новый [шаблон](building-sites/elements/templates "Шаблоны") . | -| new_tv | Создать новую [переменную шаблона](building-sites/elements/template-variables "Переменные шаблона") . | -| new_user | Создать нового [пользователя](building-sites/client-proofing/security/users "пользователей") . | -| packages | Использовать любые транспортные пакеты в системе [управления](extending-modx/transport-packages "Управление пакетами") пакетами. | -| property_sets | Для просмотра и редактирования [свойств и наборов свойств](building-sites/properties-and-property-sets "Свойства и наборы свойств") . | -| провайдеры | Для просмотра и редактирования [провайдеров](building-sites/extras/providers "Провайдеры") по всему сайту. | -| publish_document | Опубликовать или отменить публикацию любого ресурса. В UI менеджера проверка идёт на контексте **`mgr`** через `hasPermission('publish_document')`. Выдача только на другом контексте кнопки публикации не откроет. См. [ACL](building-sites/client-proofing/security/policies/acls#publikaciya-v-menedzhere-i-neskolko-grupp). | -| purge_deleted | Чтобы очистить корзину. | -| remove | Основное разрешение на удаление любого объекта. | -| remove_locks | Удалить все существующие блокировки по всему сайту. | -| resource_tree | Для просмотра дерева ресурсов в левой навигационной панели. | -| save | Базовое разрешение на сохранение любого объекта. | -| save_category | Чтобы сохранить любые категории. | -| save_chunk | Чтобы сохранить любые [куски](building-sites/elements/chunks "Куски") . | -| save_context | Сохранить любой [контекст](building-sites/contexts "Контексты") . | -| save_document | Чтобы сохранить любые [ресурсы](building-sites/resources "Ресурсы") . | -| save_plugin | Чтобы сохранить любые [плагины](extending-modx/plugins "Плагины") . | -| save_role | Чтобы сохранить любые [роли](building-sites/client-proofing/security/roles "Роли") . | -| save_snippet | Чтобы сохранить любые [сниппеты](extending-modx/snippets "обрывки") . | -| save_template | Сохранить любые [шаблоны](building-sites/elements/templates "Шаблоны") . | -| save_tv | Сохранить любые [переменные шаблона](building-sites/elements/template-variables "Переменные шаблона") . | -| save_user | Сохранить любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | -| search | Чтобы использовать страницу поиска. | -| settings | Для просмотра и редактирования любых настроек системы. | -| steal_locks | Чтобы «украсть» блокировки, переопределяя текущую блокировку документа. | -| unlock_element_properties | Чтобы иметь возможность редактировать свойства по умолчанию для любого элемента. | -| view | Базовое разрешение на «просмотр» любого объекта. | -| view_category | Для просмотра любых категорий. | -| view_chunk | Для просмотра любых [чанков](building-sites/elements/chunks "Куски") . | -| view_context | Для просмотра любых [контекстов](building-sites/contexts "Контексты") . | -| view_document | Для просмотра любых [ресурсов](building-sites/resources "Ресурсы") . | -| view_eventlog | Для просмотра журнала событий. | -| view_offline | -| view_plugin | Для просмотра любых [плагинов](extending-modx/plugins "Плагины") . | -| view_role | Для просмотра любых [ролей](building-sites/client-proofing/security/roles "Роли") . | -| view_snippet | Для просмотра любых [сниппетов](extending-modx/snippets "обрывки") . | -| view_template | Для просмотра любых [шаблонов](building-sites/elements/templates "Шаблоны") . | -| view_tv | Для просмотра любых [переменных шаблона](building-sites/elements/template-variables "Переменные шаблона") . | -| view_unpublished | Для просмотра любых неопубликованных [ресурсов](building-sites/resources "Ресурсы") . | -| view_user | Для просмотра любой [пользователь](building-sites/client-proofing/security/users "пользователей") . | -| workspaces | Использовать [управление пакетами](extending-modx/transport-packages "Управление пакетами") . | +| название | Описание доступа | +| --- | --- | +| about | О странице. | +| access_permissions | Любые связанные с разрешением доступа страницы и действия. | +| actions | Страница [действий](extending-modx/menus/actions "Действия и меню") . | +| change_password | Пользователь может изменить свой пароль пользователя. | +| change_profile | Пользователь может изменить свой профиль. | +| charsets | Видеть список кодировок. | +| class_map | Видеть список классов в карте классов. | +| components | Видеть меню «Пакеты». | +| content_types | Страница «Типы содержимого». | +| countries | Смотреть список стран. | +| create | Базовый «создать» доступ к объектам. | +| credits | Просмотрите страницу «Кредиты». | +| customize_forms | Просмотр и управление [настройкой](building-sites/client-proofing/form-customization "Настройка менеджера") страницы [менеджера](building-sites/client-proofing/form-customization "Настройка менеджера") . | +| dashboards | Просмотр и управление панелями. Пункт в верхнем меню — «Панели управления». | +| database | Страница Информация о системе | +| database_truncate | Возможность усекать таблицу базы данных. | +| delete_category | Удалить или удалить любые Категории. | +| delete_chunk | Удалить или удалить любые [чанки](building-sites/elements/chunks "Куски") . | +| delete_context | Удалить или удалить любые [контексты](building-sites/contexts "Контексты") . | +| delete_document | Удалить или удалить любые [Ресурсы](building-sites/resources "Ресурсы") . | +| delete_eventlog | Очистить журнал событий. | +| delete_plugin | Удалить или удалить любые [плагины](extending-modx/plugins "Плагины") . | +| delete_propertyset | Отключать и удалять наборы параметров. | +| delete_role | Удалить или удалить любые [роли](building-sites/client-proofing/security/roles "Роли") . | +| delete_snippet | Удалить или удалить любые [сниппеты](extending-modx/snippets "обрывки") . | +| delete_static_resource | Для удаления или отключения статического ресурса требуется разрешение "delete_document". | +| delete_symlink | Для удаления или отключения символической ссылки требуется разрешение "delete_document". | +| delete_template | Удалить или удалить любые [шаблоны](building-sites/elements/templates "Шаблоны") . | +| delete_tv | Удалить или удалить любые [переменные шаблона](building-sites/elements/template-variables "Переменные шаблона") . | +| delete_user | Удалить или удалить любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | +| delete_weblink | Для удаления или отключения ссылки требуется разрешение "delete_document". | +| directory_chmod | Изменять права доступа (chmod) к каталогам. | +| directory_create | Создавать каталоги в файловой системе. | +| directory_list | Видеть список подкаталогов для каталога в файловой системе. | +| directory_remove | Удалять папки в файловой системе. | +| directory_update | Переименовывать каталоги в файловой системе. | +| edit_category | Для редактирования любых категорий. | +| edit_chunk | Для редактирования любых [чанков](building-sites/elements/chunks "Куски") . | +| edit_context | Для редактирования любых [контекстов](building-sites/contexts "Контексты") . | +| edit_document | Для редактирования любых [ресурсов](building-sites/resources "Ресурсы") . | +| edit_locked | Позволяет пользователю отменять блокировку и редактировать заблокированный ресурс. | +| edit_plugin | Для редактирования любых [плагинов](extending-modx/plugins "Плагины") . | +| edit_propertyset | Редактировать наборы параметров. | +| edit_role | Редактировать любые [роли](building-sites/client-proofing/security/roles "Роли") . | +| edit_snippet | Для редактирования любых [сниппетов](extending-modx/snippets "обрывки") . | +| edit_static_resource | Для редактирования статических ресурсов требуется разрешение "edit_document". | +| edit_symlink | Для редактирования символических ссылок требуется разрешение "edit_document". | +| edit_template | Для редактирования любых [шаблонов](building-sites/elements/templates "Шаблоны") . | +| edit_tv | Для редактирования любых [переменных шаблона](building-sites/elements/template-variables "Переменные шаблона") . | +| edit_user | Для редактирования любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | +| edit_weblink | Для редактирования ссылок требуется разрешение "edit_document". | +| element_tree | Возможность просмотра дерева элементов на левой панели. | +| empty_cache | Очистить кеш сайта. | +| error_log_erase | Очищать журнал ошибок. | +| error_log_view | Просматривать журнал ошибок. | +| events | Видеть Системные события. | +| export_static | Для экспорта сайта в статический HTML. | +| file_create | Создавать файлы. | +| file_list | Видеть список файлов в папках. | +| file_manager | Использовать файловый менеджер, в том числе создание / удаление файлов. | +| file_remove | Удалять файлы в файловой системе. | +| file_tree | Для просмотра дерева файлов на левой панели. | +| file_unpack | Распаковать zip-архивы. | +| file_update | Редактирование содержимого физических файлов. ВНИМАНИЕ: дает возможность выполнить произвольный код на сервере. | +| file_upload | Загружать файлы в папку. | +| file_view | Просматривать содержимое файла. | +| flush_sessions | Может сбрасывать сеансы по всему сайту. | +| frames | Чтобы использовать интерфейс диспетчера MODX на всех. | +| help | Для просмотра страницы справки. | +| home | Для просмотра страницы приветствия. | +| language | Переключать текущий язык в панели управления. | +| languages | Редактировать или просматривать лексикон Языки. | +| lexicons | Для редактирования или просмотра лексиконов и [интернационализации](extending-modx/internationalization "интернационализация") . | +| list | Базовое разрешение «перечислить» любой объект. Список означает получить коллекцию объектов. | +| load | Базовое разрешение «загрузить» любой объект или иметь возможность вернуть его как экземпляр вообще. | +| logout | Чтобы можно было выйти из системы как пользователь. | +| menu_reports | Показывать в главном меню пункт «Отчёты». | +| menu_security | Показывать в главном меню пункт «Безопасность», не используется. | +| menu_site | Показывать в главном меню пункт «Содержимое». | +| menu_support | Показывать в главном меню пункт «Поддержка», не используется. | +| menu_system | Показывать в главном меню пункт «Система», не используется. | +| menu_tools | Показывать в главном меню пункт «Управление». | +| menu_trash | Показывать в главном меню пункт «Корзина». | +| menu_user | Показывать в главном меню пункт «Пользователь». | +| menus | Для редактирования или сохранения любых топовых пунктов меню. | +| messages | Для отправки или просмотра любых личных сообщений. | +| mgr_log_erase | Очищать журнал системы управления. | +| mgr_log_view | Видеть журнал системы управления. | +| namespaces | Для редактирования или просмотра [пространств имен](extending-modx/namespaces "Пространства имен") . | +| new_category | Создать новую категорию. | +| new_chunk | Создать новый [чанк](building-sites/elements/chunks "Куски") . | +| new_context | Создать новый [контекст](building-sites/contexts "Контексты") . | +| new_document | Для создания новых [ресурсов](building-sites/resources "Ресурсы") . | +| new_document_in_root | Создавать [ресурс](building-sites/resources "Ресурсы") в корне сайта. Заменяет удалённую настройку `udperms_allowroot`. | +| new_plugin | Создать новый [плагин](extending-modx/plugins "Плагины") . | +| new_propertyset | Создавать наборы параметров. | +| new_role | Создать новую [роль](building-sites/client-proofing/security/roles "Роли") . | +| new_snippet | Создать новый [сниппет](extending-modx/snippets "обрывки") . | +| new_static_resource | Создавать статичные ресурсы. | +| new_symlink | Создавать символические ссылки. | +| new_template | Создать новый [шаблон](building-sites/elements/templates "Шаблоны") . | +| new_tv | Создать новую [переменную шаблона](building-sites/elements/template-variables "Переменные шаблона") . | +| new_user | Создать нового [пользователя](building-sites/client-proofing/security/users "пользователей") . | +| new_weblink | Создавать новые веб-ссылки. | +| packages | Использовать любые транспортные пакеты в системе [управления](extending-modx/transport-packages "Управление пакетами") пакетами. | +| policy_delete | Удалять политики доступа. | +| policy_edit | Редактирование политик доступа. ВНИМАНИЕ: в сочетании с разрешением policy_save, предоставляет возможность повышения привилегий, включая права, связанные с безопасностью. | +| policy_new | Создавать новые политики доступа. | +| policy_save | Сохранять политики доступа. | +| policy_template_delete | Удалять шаблоны политик доступа. | +| policy_template_edit | Редактировать шаблоны политик доступа. | +| policy_template_new | Создавать шаблоны политик доступа. | +| policy_template_save | Сохранять шаблоны политик доступа. | +| policy_template_view | Просматривать шаблоны политик доступа. | +| policy_view | Просматривать политики доступа. | +| property_sets | Для просмотра и редактирования [свойств и наборов свойств](building-sites/properties-and-property-sets "Свойства и наборы свойств") . | +| providers | Смотреть и изменять поставщиков пакетов. | +| publish_document | Опубликовать или отменить публикацию любого ресурса. В UI менеджера проверка идёт на контексте **`mgr`** через `hasPermission('publish_document')`. Выдача только на другом контексте кнопки публикации не откроет. См. [ACL](building-sites/client-proofing/security/policies/acls#публикация-в-менеджере-и-несколько-групп). | +| purge_deleted | Чтобы очистить корзину. | +| remove | Основное разрешение на удаление любого объекта. | +| remove_locks | Удалить все существующие блокировки по всему сайту. | +| resource_duplicate | Создавать копию Ресурса. | +| resource_quick_create | Использовать «Быстро создать Ресурс» в дереве ресурсов слева. | +| resource_quick_update | Использовать «Быстро редактировать ресурс» в контекстном меню. | +| resource_tree | Для просмотра дерева ресурсов в левой навигационной панели. | +| resourcegroup_delete | Удалять Группы ресурсов. | +| resourcegroup_edit | Редактировать Группы ресурсов. | +| resourcegroup_new | Создавать новые Группы ресурсов. | +| resourcegroup_resource_edit | Редактировать Ресурсы в Группе ресурсов. | +| resourcegroup_resource_list | Просматривать Ресурсы в Группе ресурсов. | +| resourcegroup_save | Сохранять Группы ресурсов. | +| resourcegroup_view | Просматривать Группы ресурсов. | +| save | Базовое разрешение на сохранение любого объекта. | +| save_category | Чтобы сохранить любые категории. | +| save_chunk | Чтобы сохранить любые [куски](building-sites/elements/chunks "Куски") . | +| save_context | Сохранить любой [контекст](building-sites/contexts "Контексты") . | +| save_document | Чтобы сохранить любые [ресурсы](building-sites/resources "Ресурсы") . | +| save_plugin | Чтобы сохранить любые [плагины](extending-modx/plugins "Плагины") . | +| save_propertyset | Сохранять Наборы параметров. | +| save_role | Чтобы сохранить любые [роли](building-sites/client-proofing/security/roles "Роли") . | +| save_snippet | Чтобы сохранить любые [сниппеты](extending-modx/snippets "обрывки") . | +| save_template | Сохранить любые [шаблоны](building-sites/elements/templates "Шаблоны") . | +| save_tv | Сохранить любые [переменные шаблона](building-sites/elements/template-variables "Переменные шаблона") . | +| save_user | Сохранить любого [пользователя](building-sites/client-proofing/security/users "пользователей") . | +| search | Чтобы использовать страницу поиска. | +| set_sudo | Сделать любого пользователя Суперпользователем. | +| settings | Для просмотра и редактирования любых настроек системы. | +| source_delete | Удалять Источник файлов. | +| source_edit | Редактировать Источник файлов. | +| source_save | Создавать и сохранять Источник файлов. | +| source_view | Видеть Источник файлов. | +| sources | Управлять Источниками файлов и Типами источников файлов. | +| steal_locks | Чтобы «украсть» блокировки, переопределяя текущую блокировку документа. | +| tree_show_element_ids | Показывать ID в Дереве элементов. | +| tree_show_resource_ids | Показывать ID в Дереве ресурсов. | +| undelete_document | Возможность отменять удаление Ресурсов. | +| unlock_element_properties | Чтобы иметь возможность редактировать свойства по умолчанию для любого элемента. | +| unpublish_document | Отменять публикацию ресурсов. | +| usergroup_delete | Удалять Группы пользователей. | +| usergroup_edit | Редактирование групп пользователей. ВНИМАНИЕ: раскрывает настройки UserGroup, которые могут переопределить параметры системы, связанные с безопасностью, такие как загружаемые типы файлов и учетные данные API. | +| usergroup_new | Создавать новые Группы пользователей. | +| usergroup_save | Сохранять Группы пользователей. | +| usergroup_user_edit | Редактировать Пользователей в Группе пользователей. | +| usergroup_user_list | Видеть список Пользователей в Группе пользователей. | +| usergroup_view | Просматривать Группы пользователей. | +| view | Базовое разрешение на «просмотр» любого объекта. | +| view_category | Для просмотра любых категорий. | +| view_chunk | Для просмотра любых [чанков](building-sites/elements/chunks "Куски") . | +| view_context | Для просмотра любых [контекстов](building-sites/contexts "Контексты") . | +| view_document | Для просмотра любых [ресурсов](building-sites/resources "Ресурсы") . | +| view_element | Получать список Элементов или Классов элементов. | +| view_eventlog | Для просмотра журнала событий. | +| view_offline | Просматривать сайт, если он находится режиме офлайна. | +| view_plugin | Для просмотра любых [плагинов](extending-modx/plugins "Плагины") . | +| view_propertyset | Просматривать Наборы параметров. | +| view_role | Для просмотра любых [ролей](building-sites/client-proofing/security/roles "Роли") . | +| view_snippet | Для просмотра любых [сниппетов](extending-modx/snippets "обрывки") . | +| view_sysinfo | Просматривать страницу информации о системе. | +| view_template | Для просмотра любых [шаблонов](building-sites/elements/templates "Шаблоны") . | +| view_tv | Для просмотра любых [переменных шаблона](building-sites/elements/template-variables "Переменные шаблона") . | +| view_unpublished | Для просмотра любых неопубликованных [ресурсов](building-sites/resources "Ресурсы") . | +| view_user | Для просмотра любой [пользователь](building-sites/client-proofing/security/users "пользователей") . | +| workspaces | Использовать [управление пакетами](extending-modx/transport-packages "Управление пакетами") . | ## Пользовательские разрешения -Если вы создали свои собственные действия и пункты меню [страницу настраиваемого менеджера](extending-modx/custom-manager-pages "Пользовательский менеджер страниц Учебникl"), то вы можете определить настраиваемые элементы разрешений при создании элемента меню (Система -> Действия -> Создать меню), который соответствует разрешения перечислены здесь. +Если вы создали свои собственные действия и пункты меню [страницу настраиваемого менеджера](extending-modx/custom-manager-pages "Пользовательский менеджер страниц Учебникl"), то вы можете определить настраиваемые элементы разрешений при создании элемента меню (**Admin → Actions → Create Menu**), который соответствует разрешения перечислены здесь. -![](/2.x/en/building-sites/client-proofing/security/policies/permissions/modx+custom+permission.jpg) +![](modx+custom+permission.jpg) ## Смотрите также -1. [Разрешения - Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) -2. [Разрешения - Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/permissions/index.md b/ru/building-sites/client-proofing/security/policies/permissions/index.md index 91bdaebd0..e740771eb 100644 --- a/ru/building-sites/client-proofing/security/policies/permissions/index.md +++ b/ru/building-sites/client-proofing/security/policies/permissions/index.md @@ -1,6 +1,7 @@ --- title: "Разрешения" translation: "building-sites/client-proofing/security/policies/permissions" +description: "Разрешения MODX: что такое одно разрешение и как политики группируют их." --- ## Что такое Разрешения? @@ -20,27 +21,26 @@ translation: "building-sites/client-proofing/security/policies/permissions" 1. [Права Доступа - Политика Администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) 2. [Права Доступа - Политика Ресурса](building-sites/client-proofing/security/policies/permissions/resource-policy) +Шаблоны политик организуют списки разрешений в политиках доступа. Политика доступа — это список чекбоксов, а шаблоны политик определяют, какие чекбоксы доступны в политике. Полный список разрешений может быть очень длинным, поэтому определять политики, перебирая сотни чекбоксов, неэффективно. Шаблоны политик позволяют сузить набор доступных опций. + ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы Ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) - 1. [Права Доступа](building-sites/client-proofing/security/policies/permissions) - 1. [Права Доступа - Политика Администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Права Доступа - Политика Ресурса](building-sites/client-proofing/security/policies/permissions/resource-policy) - 2. [КД](building-sites/client-proofing/security/policies/acls) - 3. [Шаблоны Политик](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Предоставление доступа "User Manager"](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) - 2. [Создание "Member-Only" страниц](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Создание второго "Super Admin" пользователя](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Элементов от пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе анонимных пользователей](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Закалка MODX Revolution](getting-started/maintenance/securing-modx) -8. [Стандарты безопасности](administering-your-site/security/security-standards) -9. [Поиск проблем в безопасности](building-sites/client-proofing/security/troubleshooting-security) - 1. [Сбрость пароля пользователя в ручную](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) - -Есть так же "Шаблоны Политик" - они помогают организовать списки разрешений в политиках доступа. Политики Доступа - это список чекбоксов, шаблоны политик определяют, какие флажки доступны для Политики доступа. Поскольку полный список разрешений может быть довольно длинным, не эффективно назначать Политики Доступа пробираясь через сотни чекбоксов. Шаблоны политик позволяют сузить параметры, доступные для политики доступа. +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/permissions/modx+custom+permission.jpg b/ru/building-sites/client-proofing/security/policies/permissions/modx+custom+permission.jpg new file mode 100644 index 000000000..507f39fd4 Binary files /dev/null and b/ru/building-sites/client-proofing/security/policies/permissions/modx+custom+permission.jpg differ diff --git a/ru/building-sites/client-proofing/security/policies/permissions/resource-policy.md b/ru/building-sites/client-proofing/security/policies/permissions/resource-policy.md index 433725a14..68c5c10b7 100644 --- a/ru/building-sites/client-proofing/security/policies/permissions/resource-policy.md +++ b/ru/building-sites/client-proofing/security/policies/permissions/resource-policy.md @@ -1,6 +1,7 @@ --- title: "Ресурсная политика" translation: "building-sites/client-proofing/security/policies/permissions/resource-policy" +description: "Ресурсная политика MODX и список её разрешений." --- ## Ресурсная политика @@ -12,6 +13,7 @@ translation: "building-sites/client-proofing/security/policies/permissions/resou | Имя | |------| | add\_children | +| copy | | create | | delete | | list | @@ -29,5 +31,22 @@ translation: "building-sites/client-proofing/security/policies/permissions/resou ## Смотрите также -1. [Разрешения - Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) -2. [Разрешения - Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/policies/policy1-perm.png b/ru/building-sites/client-proofing/security/policies/policy1-perm.png new file mode 100644 index 000000000..c6a669f66 Binary files /dev/null and b/ru/building-sites/client-proofing/security/policies/policy1-perm.png differ diff --git a/ru/building-sites/client-proofing/security/policies/policy1.png b/ru/building-sites/client-proofing/security/policies/policy1.png new file mode 100644 index 000000000..6e0809c67 Binary files /dev/null and b/ru/building-sites/client-proofing/security/policies/policy1.png differ diff --git a/ru/building-sites/client-proofing/security/policies/policytemplates.md b/ru/building-sites/client-proofing/security/policies/policytemplates.md index 260f71138..f6d7cdb57 100644 --- a/ru/building-sites/client-proofing/security/policies/policytemplates.md +++ b/ru/building-sites/client-proofing/security/policies/policytemplates.md @@ -1,6 +1,7 @@ --- title: "Шаблоны политик" translation: "building-sites/client-proofing/security/policies/policytemplates" +description: "Шаблоны политик MODX и группы, которые их объединяют." --- ## Что такое шаблоны политик? @@ -33,24 +34,42 @@ ResourceTemplate определяет дополнительные разреш ContextTemplate определяет доступ к контексту, когда административные действия не задействованы. +### NamespaceTemplate + +NamespaceTemplate содержит три разрешения пространства имён: `list`, `load` и `view`. + +## Policy Template Groups + +Шаблоны объединяются в группы, и группа решает, в какой части списка политик показывается политика. В MODX 3 семь групп: + +| Группа | Шаблоны в ней | +| --- | --- | +| Administrator | AdministratorTemplate | +| Object | ObjectTemplate | +| Resource | ResourceTemplate | +| Element | ElementTemplate | +| MediaSource | MediaSourceTemplate | +| Namespace | NamespaceTemplate | +| Context | ContextTemplate | + ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Предоставление доступа менеджеру пользователей](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) - 2. [Создание страниц только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Создание второго суперадминистратора](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение доступа пользователей к элементу](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе анонимных пользователей](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Защита MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем с безопасностью](building-sites/client-proofing/security/troubleshooting-security) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/resource-groups.md b/ru/building-sites/client-proofing/security/resource-groups.md index cb18f6485..1892866f0 100644 --- a/ru/building-sites/client-proofing/security/resource-groups.md +++ b/ru/building-sites/client-proofing/security/resource-groups.md @@ -1,6 +1,7 @@ --- title: "Группы ресурсов" translation: "building-sites/client-proofing/security/resource-groups" +description: "Группы ресурсов MODX: как они собирают ресурсы и как группа получает к ним доступ." --- ## Что такое группа ресурсов? @@ -13,7 +14,7 @@ translation: "building-sites/client-proofing/security/resource-groups" ### Вариант 1 -Откройте Security -> Resource Groups. Слева увидите список групп ресурсов, справа дерево ресурсов. +Откройте иконка замка в меню пользователя → **Resource Groups**. Слева увидите список групп ресурсов, справа дерево ресурсов. Перетащите ресурсы из правого дерева прямо в группы ресурсов в левом: @@ -29,22 +30,22 @@ translation: "building-sites/client-proofing/security/resource-groups" ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - политика Administrator](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - политика Resource](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Усиление защиты MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем безопасности](building-sites/client-proofing/security/troubleshooting-security) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/resource_groups_edit.jpg b/ru/building-sites/client-proofing/security/resource_groups_edit.jpg new file mode 100644 index 000000000..6d180414a Binary files /dev/null and b/ru/building-sites/client-proofing/security/resource_groups_edit.jpg differ diff --git a/ru/building-sites/client-proofing/security/roles-grid.png b/ru/building-sites/client-proofing/security/roles-grid.png new file mode 100644 index 000000000..1ae8cc597 Binary files /dev/null and b/ru/building-sites/client-proofing/security/roles-grid.png differ diff --git a/ru/building-sites/client-proofing/security/roles.md b/ru/building-sites/client-proofing/security/roles.md index 0e6386ca0..29b44fd8c 100644 --- a/ru/building-sites/client-proofing/security/roles.md +++ b/ru/building-sites/client-proofing/security/roles.md @@ -1,65 +1,84 @@ --- title: "Роли" translation: "building-sites/client-proofing/security/roles" +description: "Роли MODX: число authority, которое они несут, и как оно сравнивается с доступом группы." --- ## Что такое роль? -Роль это должность или статус в конкретной ситуации. В MODX ею задают положение пользователя внутри группы пользователей, например "Editor" или "Front-end Read Only". +Роль задаёт положение пользователя внутри группы пользователей, например "Editor" или "Front-end Read Only". -Роли в MODX используют целое число Authority. **Меньшее число означает более сильные полномочия.** Например, роль с Authority 10 наследует все Group Policies, назначенные ей самой и любым ролям с Authority 11. Роль с Authority 11 не наследует Group Policies роли с Authority 10. +Роли используют целое число Authority. **Меньшее число означает более сильные полномочия.** Пользователь проходит проверку ACL, когда authority его роли **не больше** authority этого ACL. Пользователь с ролью authority 10 проходит все ACL, которые проходит пользователь с ролью authority 11. -Говоря об Authority, формулируйте аккуратно: обратная зависимость часто путает формулировки. +Authority удобно читать как порядковый номер: первый, второй, третий. **Authority=1** это первые полномочия, и они сильнее **Authority=2**. -Authority удобно мыслить как порядковые номера: первый, второй, третий и так далее. **Authority=1** это первые полномочия и они сильнее **Authority=2** (вторых). +**Номера Authority уникальны** +База не даст создать две роли с одинаковым authority: у столбца уникальный индекс. -Одинаковые номера Authority лучше не дублировать. +## Роли MODX + +В MODX 3 поставляется две роли: + +| Роль | Authority | +| --- | --- | +| Member | 9999 | +| Super User | 0 | + +Роль **Super User** проходит проверку любого ACL, потому что authority у ACL не бывает ниже 0. Роль **Member** проходит только те ACL, у которых authority равен 9999 или больше. + +## Права страницы + +| Право | Что даёт | +| --- | --- | +| `view_role` | Увидеть список. | +| `new_role`, `save_role` | Создать роль. | +| `edit_role` | Изменить роль. | +| `delete_role` | Удалить роль. | ## Использование -Частый пример: роли по структуре должностей. Допустим, вы создаёте такие роли и уровни Authority: +Создайте роли по должностям. Authority должен быть уникальным. У Super User уже стоит 0, у Member уже стоит 9999. -- Administrator - 0 - Director - 1 - Coordinator - 2 - Supervisor - 3 -- Employee - 9999 +- Employee - 10 ![](roles-grid.png) -Затем создайте группу пользователей "HR Department". Внутри группы назначьте пользователям эти роли (на одну роль может приходиться несколько пользователей). +Создайте группу пользователей "HR Department" и назначьте пользователям эти роли. На одну роль может приходиться несколько пользователей. -Допустим, у John роль Coordinator, у Mark роль Supervisor. Группе пользователей "HR Deparment" вы даёте Access Policy (набор Permissions) с именем "AccountPolicy" и такими Access Permissions: +У John роль Coordinator, у Mark роль Supervisor. Группе "HR Department" дайте политику доступа "AccountPolicy" на контексте "web" и поставьте Minimum Role в "Supervisor": -- view\_accounts -- save\_accounts +![](ug-ctx-grid1.png) -Эту политику вы назначили контексту "web" для группы "HR Department". Значение Minimum Role поставили в "Supervisor": +В политике такие разрешения: -![](ug-ctx-grid1.png) +- `view_accounts` +- `save_accounts` -Значит, у Mark есть эти Permissions: он в группе и его роль не слабее "Supervisor" (именно эту роль он и занимает). +У Mark есть эти разрешения. Он в группе, и его роль не слабее "Supervisor". -Но **также** эти Permissions есть у John: у него роль "Coordinator" с более сильным Authority, чем у "Supervisor". То есть John как Coordinator «унаследовал» Permissions, которые Mark имел как Supervisor. +Они есть и у John. У Coordinator authority сильнее, чем у Supervisor, поэтому у John есть разрешения, которые есть у Mark как у Supervisor. ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - политика Administrator](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - политика Resource](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Усиление защиты MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем безопасности](building-sites/client-proofing/security/troubleshooting-security) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/sec-ugctx1.png b/ru/building-sites/client-proofing/security/sec-ugctx1.png new file mode 100644 index 000000000..6d9d53945 Binary files /dev/null and b/ru/building-sites/client-proofing/security/sec-ugctx1.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/access+controls.png b/ru/building-sites/client-proofing/security/security-tutorials/access+controls.png new file mode 100644 index 000000000..f232d3bcc Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/access+controls.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/context-access.png b/ru/building-sites/client-proofing/security/security-tutorials/context-access.png new file mode 100644 index 000000000..622337142 Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/context-access.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/create-resource-group.png b/ru/building-sites/client-proofing/security/security-tutorials/create-resource-group.png new file mode 100644 index 000000000..c51fa072b Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/create-resource-group.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md b/ru/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md index a60af7c30..767069db2 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user.md @@ -1,27 +1,30 @@ --- title: "Второй пользователь Super Admin" translation: "building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user" +description: "Создать второго администратора MODX: группа и роль, которые дают нужные права." --- ## Задача Вы хотите, чтобы ещё один пользователь MODX Revolution имел полный доступ к менеджеру со всеми [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") администратора. Это может быть коллега или клиент. Создавая ещё одного Administrator, вы отдаёте ключи от _всего_ сайта. Сценарий упрощённый: другой админ сможет изменить или удалить вашу учётную запись, так что для вашей задачи это может не подойти. По ходу шагов страница кратко знакомит с ролями и политиками доступа. +Чтобы дать менеджеру доступ в меньшем объёме, посмотрите урок [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access "Giving a User Manager Access"). Видео Shaun McCormick [Understanding MODX Revolution Security](http://vimeo.com/13856994) подробно показывает сложные схемы прав. + ## Решение Войдите в менеджер сайта и сделайте следующее: -1. Создайте нового пользователя: Manage -> Users -> New User (кнопка) +1. Создайте нового пользователя: иконка замка в меню пользователя → **Users** -> New User (кнопка) 2. Задайте уникальные username, password и email. -3. Перед сохранением откройте вкладку **Access Permissions** и нажмите **Add User Group to User** +3. Перед сохранением откройте вкладку **Access Permissions** и нажмите ****Add User to Group**** 1. **User Group:**`Administrator` 2. **Role:**`Super User` -4. Сохраните пользователя. (Позже можно вернуться в Security -> Manage Users и правым кликом обновить свойства.) +4. Сохраните пользователя. (Позже можно вернуться в иконка замка в меню пользователя → **Users** и правым кликом обновить свойства.) 5. Проверьте вход в менеджер из другого браузера. ## Почему нельзя добавить ещё одного Administrator с другой [ролью](building-sites/client-proofing/security/roles "Roles"), например "Member"? -Попробуйте. При входе под другим именем только с ролью "Member" доступ отклонят. Почему? Дело в [Context Access](building-sites/contexts "Contexts") и [Access Policies](building-sites/client-proofing/security/policies "Policies"). Они быстро усложняются. Откройте Security -> Access Controls, правым кликом по группе Administrator выберите Update User Group, затем вкладку **Context Access**. Увидите примерно такое: +Попробуйте. При входе под другим именем только с ролью "Member" доступ отклонят. Почему? Дело в [Context Access](building-sites/contexts "Contexts") и [Access Policies](building-sites/client-proofing/security/policies "Policies"). Они быстро усложняются. Откройте иконка замка в меню пользователя → **Access Control Lists**, правым кликом по группе Administrator выберите Update User Group, затем вкладку **Context Access**. Увидите примерно такое: ![](user-group-perms.jpg) @@ -39,12 +42,22 @@ translation: "building-sites/client-proofing/security/security-tutorials/creatin ## Смотрите также -См. также урок [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access "Giving a User Manager Access"): там пример пользователя с уровнем прав ниже вашего. - -Видео Shaun McCormick [Understanding MODX Revolution Security](http://vimeo.com/13856994) подробно показывает сложные схемы прав. - -1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md b/ru/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md index 4f30b4afb..1b33aaa6e 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access.md @@ -1,23 +1,24 @@ --- title: "Доступ пользователя к Менеджеру" translation: "building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access" +description: "Дать пользователю MODX права менеджера: группа, роли и политика, которые это делают." --- ## Задача -Нужен доступ к редактированию в Менеджере без полного набора [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions") администратора. Учебник частично написан BobRay. +Нужен доступ к редактированию в менеджере без полного набора [разрешений](building-sites/client-proofing/security/policies/permissions "Разрешения") администратора. Часть учебника написал BobRay. ## Решение -1. В **Access Controls → Roles** создайте роль (например, `Editor`) с authority `10`. -2. В **Settings → Access Control Lists → Access Policies** продублируйте политику Administrator и переименуйте (например, `AdminLite`). +1. В иконке замка → **Контроль доступа** откройте вкладку **Роли** и создайте роль (например, `Editor`) с authority `10`. +2. На вкладке **Политики доступа** продублируйте политику Administrator и переименуйте (например, `AdminLite`). 3. В политике AdminLite оставьте только нужные [Permissions](building-sites/client-proofing/security/policies/permissions "Permissions"). -4. В **Settings → Access Control Lists → User Groups** кликните правой кнопкой группу `Administrator` и выберите **Update User Group**. -5. На вкладке **Permissions → Context Access** добавьте две строки: +4. На вкладке **Группы пользователей & Пользователи** щёлкните правой кнопкой группу `Administrator` и выберите **Редактировать группу пользователя**. +5. На вкладке **Контексты** нажмите **Добавить доступ к контексту** и добавьте две строки: 1. Context: `mgr`, Minimum Role: `Editor`, Access Policy: `AdminLite` 2. Context: `web`, Minimum Role: `Editor`, Access Policy: `Load, List and View` -6. В **Manage → Users** создайте пользователя или откройте существующего. На вкладке Access Permissions добавьте его в группу Administrator с ролью Editor. -7. Откройте **Security → Flush Sessions** и войдите снова. +6. В иконке замка → **Пользователи** создайте пользователя или откройте существующего. На вкладке **Права доступа** добавьте его в группу Administrator с ролью Editor. +7. Откройте иконку замка → **Завершить все сеансы** и войдите снова. ## Публикация в менеджере @@ -31,8 +32,22 @@ translation: "building-sites/client-proofing/security/security-tutorials/giving- ## Смотрите также -1. [Доступ пользователя к Менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Создание второго Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Ограничение элемента для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [Ещё про группу Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/security-tutorials/index.md b/ru/building-sites/client-proofing/security/security-tutorials/index.md index f12189eac..373cd490e 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/index.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/index.md @@ -1,6 +1,7 @@ --- title: "Учебники по безопасности" translation: "building-sites/client-proofing/security/security-tutorials" +description: "Учебники раздела безопасности MODX: страницы только для участников, менеджеры, анонимный пользователь и доступ к элементам." --- ## Учебники по безопасности diff --git a/ru/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md b/ru/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md index ecd118e62..1499fc331 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/making-member-only-pages.md @@ -1,133 +1,95 @@ --- title: "Страницы только для участников" translation: "building-sites/client-proofing/security/security-tutorials/making-member-only-pages" +description: "Защитить страницы сайта на MODX так, чтобы их видели только участники группы." --- -## Введение +## Шаги -В MODX Revolution другая система безопасности: больше гибкости при выдаче (и запрете) доступа к ресурсам Manager и Web. Этот документ помогает войти в основы этой продвинутой схемы. +Эти шаги закрывают страницы сайта так, чтобы их видели только определённые пользователи. Считается, что регистрация и вход уже сделаны пакетом [Login](/extras/login "Login"). На то, какие ресурсы пользователь видит или правит в менеджере, шаги не влияют. -На front-end часто нужны страницы, которые видят только определённые пользователи. Урок показывает, как сделать это в MODX Revolution. Предполагается, что вы уже умеете регистрировать пользователей и входить через компоненты пакета [Login](/extras/login "Login"). Описанные шаги не влияют на то, какие ресурсы пользователь видит или правит в MODX Manager. - -Если вы уже ориентируетесь, ниже краткий список. Он проведёт по схеме или напомнит порядок. Если нужны подробности и примеры, прокрутите к соответствующим подразделам. - -1. Создайте Resource Group (Security -> Resource Groups -> Create Resource Group) -2. Привяжите ресурс «только для участников» к Resource Group. (Через редактирование ресурса или перетаскиванием из дерева ресурсов вправо) -3. Создайте User Group (Security -> Access Controls -> User Groups -> New User Group) +1. Создайте группу ресурсов (иконка замка в меню пользователя → **Resource Groups** → **Create Resource Group**) +2. Привяжите ресурс «только для участников» к группе ресурсов. (Через редактирование ресурса или перетаскиванием из дерева ресурсов вправо) +3. Создайте группу пользователей (иконка замка в меню пользователя → **Контроль доступа** → вкладка **Группы пользователей & Пользователи** → New User Group) 4. На вкладке Resource Group Access добавьте запись (context: web, minimum role: Member (9999), access policy: Resource) -5. Добавьте пользователей в группу с ролью Member. (Security -> Manage Users) -6. Сбросьте права (Security -> Flush Permissions) и проверьте в другом браузере (не просто в другом окне: в другом браузере) +5. Добавьте пользователей в группу с ролью Member. (иконка замка в меню пользователя → **Пользователи**) +6. Сбросьте права (**Перезагрузить права доступа**) и проверьте в другом браузере (не в другом окне того же браузера: в другом браузере) -## Access Wizard (2.2.2 и новее) +## Access Wizard -В MODX 2.2.2 есть access wizard, который упрощает процесс. Пошаговое объяснение по-прежнему верно, но wizard сокращает шаги. Имеет смысл прочитать оба варианта, чтобы лучше понять, как части системы безопасности MODX связаны. +Мастер группы ресурсов проводит по всему процессу. Результат тот же, что при ручной настройке каждого шага. -### 1. Создайте Resource Group +### 1. Создайте группу ресурсов -Откройте Security -> Resource Groups и нажмите Create Resource Group. Появится окно примерно такое: ![](create-resource-group.png) +[Группа ресурсов](building-sites/client-proofing/security/resource-groups "Группы ресурсов") собирает ресурсы, которые можно связать с группами пользователей и записями доступа. -Разберём секции: +Откройте иконку замка в меню пользователя → **Resource Groups** и нажмите **Create Resource Group**. Появится окно примерно такое: ![](create-resource-group.png) | Section | Explanation | Tutorial Default | | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | Name | Имя создаваемой группы ресурсов. Сделайте его понятным и лёгким для запоминания. | Protected | | Contexts | Контекст, в котором действуют правила. В этом уроке один контекст, "web", и скрывать нужно только там. | web | -| Automatically give Administrator Group Access | Если отметить, все пользователи группы administrator по умолчанию получат доступ к группе ресурсов. С 2.2.1 пользователь admin по умолчанию помечен как "sudo" и видит все группы ресурсов независимо от доступа группы administrator. Если есть другие администраторы без sudo и вы хотите, чтобы они видели ресурсы группы, отметьте этот пункт. | checked | -| Automatically give Anonymous Group Access | Если отметить, все пользователи группы anonymous получат доступ к группе ресурсов. Посетитель сайта без входа считается в группе anonymous. Мы защищаем страницы от незалогиненных, поэтому в уроке оставляем пункт снятым. | unchecked | +| Automatically give Administrator Group Access | Если отметить, все пользователи группы administrator по умолчанию получат доступ к группе ресурсов. Пользователь admin по умолчанию помечен как "sudo", а sudo обходит проверки политик, поэтому он видит все группы ресурсов независимо от доступа группы administrator. Если есть другие администраторы без sudo и им нужно видеть ресурсы группы, отметьте этот пункт. | checked | +| Automatically give Anonymous Group Access | Если отметить, анонимный пользователь получит доступ к группе ресурсов. Посетитель без входа и есть анонимный пользователь. В этом уроке страницы закрыты от него, поэтому пункт оставляем снятым. | unchecked | | Create Parallel User Group | Не обязательно держать всех, кто видит страницы «только для участников», в группе administrator (если отметили "Automatically give Administrator Group Access"). Можно создать другую группу пользователей с доступом к ресурсам этой группы ресурсов. Отметьте: участники не администраторы. | checked | | Automatically Give Other User Groups Access | Если до урока у вас уже были группы пользователей, которым нужен доступ, перечислите их здесь. | | -Готово: есть группа ресурсов и группа пользователей. Дальше добавьте ресурсы в группу ресурсов и пользователей в группу пользователей. +### 2. Добавьте ресурсы в группу ресурсов -### 2. Добавьте ресурсы в Resource Group +Укажите MODX, какие ресурсы защищать. Оставайтесь на странице из шага 1 (иконка замка в меню пользователя → **Resource Groups**). Справа откройте контекст web, чтобы видеть страницы сайта. Перетащите их из правой колонки в группу ресурсов. Либо откройте каждый ресурс, вкладку **Resource Groups** (**Группы ресурсов**) и отметьте **Access** (**Доступ**) в строке "Protected". -Укажите MODX, какие ресурсы защищать. Оставайтесь на странице из шага 1 (Security > Resource Groups). Справа откройте контекст web, чтобы видеть страницы сайта. Перетащите их из правой колонки в группу ресурсов. Либо откройте каждый ресурс, вкладку Resource Groups и отметьте **Access** в строке "Protected". +### 3. Добавьте пользователей в группу пользователей -### 3. Добавьте пользователей в User Group +Откройте иконку замка → **Контроль доступа**. На вкладке **Группы пользователей & Пользователи** виден список групп. Щёлкните правой кнопкой группу «Protected» и выберите **Добавить пользователя в группу**. В "Name" выберите пользователя. В Role пока поставьте "Member". Роли задают, что пользователь может внутри группы, но для урока такая тонкость не нужна. Нажмите Save. -Со страницей Resource Group закончили. Откройте Security > Access Controls. На вкладке Users Groups виден список групп. Правым кликом по группе "Protected" выберите "Add User to Group". В "Name" выберите пользователя. В Role пока поставьте "Member". Роли задают, что пользователь может внутри группы, но для урока такая тонкость не нужна. Нажмите Save. +Ресурс защищён, когда он (1) назначен в одну или несколько групп ресурсов и (2) группа связана с группой пользователей через контроль доступа. Такие страницы не показываются пользователям вне этой связи. По умолчанию это страница 404. Чтобы вернуть 401, дайте анонимному пользователю разрешение "load" на группу ресурсов. Подробнее в другом уроке. Сейчас страница ещё не видна: вы ещё не добавили её в группу пользователей. -Важно: как только вы защитили ресурс, (1) назначив его в одну или несколько групп ресурсов и (2) связав группу ресурсов с группой пользователей через access control, эти страницы перестанут показываться пользователям вне связи с группой ресурсов. Поведение по умолчанию: страница 404. Если нужен ответ 401, группе anonymous нужно разрешение "load" на группу ресурсов. Подробнее в другом уроке. Сейчас ваша страница ещё не видна: вы ещё не добавили её в группу пользователей. +Если регистрация идёт через сниппет, проверьте, что новые пользователи попадают в нужную группу. -Ресурсы в группе ресурсов, пользователи в группе пользователей. Готово? Нет: осталось несколько мелочей. Если это ваш первый опыт с безопасностью MODX, часто ловят такой момент: у созданной группы пользователей нет context access к front-end контексту web. То есть если бы контекст был доступен, были бы доступны и защищённые ресурсы. Сейчас контекст недоступен. Дайте группе право смотреть этот контекст. +У созданной группы нет доступа к контексту web. Если бы контекст был доступен, были бы доступны и защищённые ресурсы. Сейчас контекст недоступен. Добавьте этот доступ следующим шагом. -### 4. Добавьте Context Access группе пользователей +### 4. Добавьте доступ к контексту -Откройте Security > Access Controls. Правым кликом по защищённой группе выберите "Update user group". Вкладка Context Access. Нажмите "Add Context". Появится диалог как ниже. Разберём: ![](context-access.png) +Откройте иконку замка → **Контроль доступа**. Щёлкните правой кнопкой защищённую группу и выберите **Редактировать группу пользователя**. Откройте вкладку **Контексты** и нажмите **Добавить доступ к контексту**. В диалоге такие поля: ![](context-access.png) | Section | Explanation | Tutorial Default | | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| Context | Контекст, к которому даёте доступ. Базовый случай: web и mgr. Web это публичный front-end сайта, mgr это закрытый back-end (менеджер, в котором вы вошли). | web | +| Context | Контекст, к которому даёте доступ. Базовый случай: web и mgr. Web это публичная часть сайта, mgr это менеджер, в котором вы вошли. | web | | Minimum Role | К каким ролям применяется правило. Если ко всем в группе, выберите "Member - 9999". Здесь как раз та тонкая настройка, о которой речь выше. | Member - 9999 | | Access Policy | Какие разрешения получают пользователи. Разные политики дают группам разные возможности. | Administrator | -Сделайте одно правило: "web", "Member - 9999" и "Load, List and View". Если нужен вход в менеджер MODX, добавьте второе правило для mgr: "mgr", "Member - 9999" и "Administrator". Тогда у всех этих пользователей будет admin-доступ. Чтобы сузить права, вместо этого выберите "Content Editor" или "Developer". Либо создайте свою политику в Security > Access Policies, если нужно точно задать, что можно и чего нельзя. +Сделайте одно правило: "web", "Member - 9999" и "Load, List and View". Чтобы пользователи видели менеджер, добавьте второе правило для mgr: "mgr", "Member - 9999" и "Administrator". У этих пользователей будет доступ администратора. Чтобы сузить права, выберите "Content Editor" или "Developer". Свою политику можно создать на вкладке **Политики доступа** в **Контроль доступа**. -Пользователи в группе, ресурсы в группе ресурсов, группа видит контекст. Почти готово. +### 5. Перезагрузите права доступа -### 5. Flush Permissions - -Чтобы увидеть изменения, сбросьте, что видят и делают отдельные пользователи. Откройте Security > Flush Permissions. На front-end проверяйте в другом браузере. Около 90% проблем идут от проверки не в другом браузере или от пропуска flush. Не ленитесь открыть второй браузер. Готово: страницы только для участников настроены. +Чтобы увидеть изменения, сбросьте, что видят и делают отдельные пользователи. Откройте иконку замка → **Перезагрузить права доступа**. На сайте проверяйте в другом браузере. Большая часть сбоев идёт от проверки в том же браузере или от пропуска этого сброса. Иногда нужно очистить кэш сайта, особенно для контекста mgr: элементы и ресурсы могут кэшировать права. -## Пошаговое объяснение (до 2.2.2) - -Если wizard вам меньше подходит или вы хотите понимать, что происходит при каждом праве и access entry, этот раздел полезен. С 2.2.2 в MODX есть Access Wizard, и с него можно начать. - -### 1. Создайте Resource Group - -[Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") это набор ресурсов, который вы связываете с группами пользователей и записями access list. Создав группу, вы легко относите страницы к видимости только для определённых групп или ролей внутри групп. - -Чтобы создать группу, откройте Security -> Resource Groups и нажмите Create Resource Group. В окне введите имя. В уроке ожидается имя "Protected". - -### 2. Привяжите ресурс «только для участников» к Resource Group - -Группа есть. Добавьте в неё ресурсы. Способов два. - -Первый: Security -> Resource Groups и перетащите ресурсы из правого дерева в левые группы ("Protected"). Второй: откройте ресурс и отметьте **Access** на вкладке Resource Groups. - -### 3. Создайте User Group - -Ресурсы в группе. Решите, кто их увидит. Для этого создайте новую группу пользователей. - -Откройте Security -> Access Controls. На вкладке User Groups (по умолчанию) нажмите New User Group. Задайте имя группы и отправьте форму. - -### 4. Добавьте доступ к Resource Group - -Перейдите на вкладку "Resource Group Access". Здесь задают, к каким группам ресурсов есть доступ у группы пользователей. Три из четырёх полей похожи на Context Access: Context, Minimum Role и Access Policy. Четвёртое: Resource Group. Как ясно из имени, это группа ресурсов, к которой есть доступ. - -Настройки: - -- Resource Group: как вы назвали, например "Protected" -- Context: web -- Minimum role: Member (9999) -- Access Policy: Resource - -Важно: как только вы защитили ресурс, (1) назначив его в одну или несколько групп ресурсов и (2) связав группу ресурсов с группой пользователей через access control, эти страницы перестанут показываться пользователям вне связи с группой ресурсов. Поведение по умолчанию: страница 404. Если нужен ответ 401, группе anonymous нужно разрешение "load" на группу ресурсов. Подробнее в другом уроке. Сейчас страница ещё не видна: вы ещё не добавили её в группу пользователей. - -### 5. Добавьте пользователей в группу - -Добавьте пользователей в группу: через редактирование пользователя или вернувшись на вкладку Users. Спросят User Group и Role. Мы исходили из роли Member с authority 9999, её и используйте. - -Если регистрация идёт через websignup snippet, убедитесь, что он сам кладёт пользователей в нужную группу. - -### 6. Flush permissions - -Когда настройки готовы, выполните flush permissions (Security -> Flush Permissions), иначе эффекта не будет. На front-end проверяйте целиком в другом браузере. Не другая вкладка и не другое окно: там всё ещё учтут вход в Manager. - -Иногда также нужно очистить кэш сайта, особенно для контекста mgr: элементы и ресурсы могут кэшировать права. - ## Всё ещё не работает? -Пройдите шаги по порядку и убедитесь, что flush permissions выполнен. Если всё кажется верным, проверьте ещё раз и спросите на Forums. Если урок кажется неточным или вводящим в заблуждение, напишите в теме форума (ссылка ниже), что исправить. +Проверьте шаги и сброс прав. Если страницы всё ещё не открываются, спросите на [MODX Community](https://community.modx.com). -## Смотрите также +Два источника помогут разобраться в самих правах. [Руководство Bob по правам](http://bobsguides.com/revolution-permissions.html) подробно раскрывает модель. Урок [Login.Basic Setup](/extras/login/login.tutorials/basic-setup "Login.Basic Setup") показывает базовую зону "Members Only" на Login Snippet. -Руководство Bob по правам: - -Тема форума по этому уроку: - -Базовая зона "Members Only" через Login Snippet: [Login.Basic Setup](/extras/login/login.tutorials/basic-setup "Login.Basic Setup") +## Смотрите также -Безопасность: [Security](building-sites/client-proofing/security "Security") +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md b/ru/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md index e73663e68..1499732be 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group.md @@ -1,32 +1,58 @@ --- title: "Ещё про группу Anonymous" translation: "building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group" +description: "Кто такой анонимный пользователь в MODX и как дать посетителю доступ, отличный от обычного." --- ## Кто такой Anonymous? -Любой посетитель сайта без входа относится к [User Group](building-sites/client-proofing/security/user-groups "User Groups") Anonymous. +Любой посетитель сайта без входа это анонимный пользователь. -Чтобы править группу, откройте верхнее меню **Security → Access Controls**, вкладка User Groups. Кликните правой кнопкой имя Anonymous и выберите **Update User Group**. ![](access+controls.png) +**Анонимный пользователь не является группой пользователей** +В базе нет группы «Anonymous». В дереве групп посетитель показан узлом `(аноним)`. Узел правится так же, как любая группа. Меняется при этом доступ анонимного пользователя. + +Откройте иконку замка → **Контроль доступа**, вкладка **Группы пользователей & Пользователи**. Щёлкните правой кнопкой `(аноним)` и выберите **Редактировать группу пользователя**. ![](access+controls.png) ## Что может Anonymous? -По умолчанию Anonymous получает Load Only во всех [Context](building-sites/contexts "Contexts"), кроме `mgr`. Без Load Only запрос к Context вернёт 404 Page Not Found. +По умолчанию анонимный пользователь получает Load Only во всех [контекстах](building-sites/contexts "Contexts"), кроме `mgr`. Без Load Only запрос к контексту вернёт 404 Page Not Found. ![](user+group_+anonymous.png) -Load Only не означает, что ресурс можно View (см. ниже). +Load Only не означает, что ресурс можно View. -Пример: вы создаёте [Resource Group](building-sites/client-proofing/security/resource-groups "Resource Groups") и даёте доступ конкретной User Group. Anonymous эту Resource Group не увидит. На этом строится [создание страниц только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages "Making Member-Only Pages"). +Если создать [группу ресурсов](building-sites/client-proofing/security/resource-groups "Группы ресурсов") и выдать её конкретной группе пользователей, анонимный пользователь её не увидит. На этом строятся [страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages "Страницы только для участников"). ### 401 против 404 на защищённых страницах -Для защищённых Resource Groups у Anonymous по умолчанию нет Load. Ответ будет 404 Page Not Found. Если нужен 401 Unauthorized, дайте Anonymous доступ к Resource Group с политикой Load Only. +У защищённой группы ресурсов у анонимного пользователя по умолчанию нет Load. Ответ будет 404 Page Not Found. Чтобы вернуть 401 Unauthorized, дайте ему доступ к группе ресурсов с политикой Load Only. -Это делается на вкладке Resource Group Access при редактировании Anonymous. +Это делается на вкладке Resource Group Access при редактировании анонимного пользователя. ![](screen+shot+2012-10-19+at+11.43.46+pm.png) -Нажмите **Add Resource Group**, выберите защищённую Resource Group, Context (не `mgr`) и Access Policy Load Only. Сохраните. - -View по ресурсам в этой группе всё ещё закрыт. Доступен только Load и ответ 401. Кастомную Unauthorized-страницу задайте через [Unauthorized Page System Setting](building-sites/settings/unauthorized_page "unauthorized_page"). +Нажмите **Add Resource Group**, выберите защищённую группу ресурсов, контекст (не `mgr`) и политику Load Only. Сохраните. + +Ресурсы этой группы он по-прежнему не увидит (нет View). Доступен только Load, ответ будет 401. Свою страницу Unauthorized задайте в настройке [Unauthorized Page](building-sites/settings/unauthorized_page "unauthorized_page"). + +## Смотрите также + +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md b/ru/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md index 3dd86feeb..ddf9e7cec 100644 --- a/ru/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md +++ b/ru/building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users.md @@ -1,102 +1,111 @@ --- title: "Ограничение Element для пользователей" translation: "building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users" +description: "Скрыть элемент MODX от пользователей, которым нельзя его править, через доступ к его категории." --- -## Введение +## Кратко -Урок показывает, как скрыть любой Element (Template, Snippet и т. д.) в менеджере MODX. Для этого используют Element Category ACL: они защищают Elements в Categories от просмотра. Пользователи группы Editors увидят элементы. Пользователи вне группы их не увидят. +Элемент (Template, Snippet и другие) скрывает ACL его категории. Пользователи группы Editors его видят. Остальные нет. -### Кратко - -1. Создайте Category или возьмите существующую -2. Поместите Element, который нужно защитить, в эту Category -3. Создайте User Group или выберите существующую -4. Добавьте пользователей, которым нужен Element, в группу с ролью Member -5. На вкладке Element Category Access добавьте Element Category ACL (context: mgr, minimum role: Member (9999), access policy: Element) -6. Выполните Flush permissions и перезагрузите +1. Создайте категорию или возьмите существующую +2. Поместите элемент, который нужно защитить, в эту категорию +3. Создайте группу пользователей или выберите существующую +4. Добавьте пользователей, которым нужен элемент, в группу с ролью Member +5. На вкладке Element Category Access добавьте ACL категории (context: mgr, minimum role: Member (9999), access policy: Element) +6. Откройте **Перезагрузить права доступа** и обновите страницу ## Пошагово -### 1. Создайте Category - -На вкладке Elements в левом дереве нажмите иконку Category на панели или правым кликом по "Categories" внизу выберите "New Category". Создайте и сохраните категорию. Можно взять уже существующую Category. +### 1. Создайте категорию -### 2. Поместите Element в Category +На вкладке Elements в левом дереве нажмите иконку Category на панели. Или правым кликом по "Categories" внизу выберите "New Category". Сохраните категорию. Можно взять уже существующую. -Отредактируйте Element и задайте ему Category из шага 1. +### 2. Поместите элемент в категорию -### 3. Создайте User Group +Отредактируйте элемент и задайте ему категорию из шага 1. -Откройте Security -> Access Controls в верхнем меню, вкладка "User Groups". Создайте новую группу или выберите существующую. Правым кликом по группе выберите "Update User Group". +### 3. Создайте группу пользователей -В Revolution 2.3.x пункт Access Control Lists лежит в меню Admin (значок шестерёнки). +Откройте иконку замка → **Контроль доступа**, вкладка **Группы пользователей & Пользователи**. Создайте группу или выберите существующую. Щёлкните её правой кнопкой и выберите **Редактировать группу пользователя**. -Если используете форму Access Wizard, в поле Context дайте группе доступ "mgr", а Category укажите в Element Categories. В поле Users можно перечислить пользователей для добавления в группу. Если wizard не используете, обновите новую группу правым кликом. +В форме Access Wizard в поле Context дайте группе "mgr", а категорию укажите в Element Categories. В поле Users можно перечислить пользователей для добавления в группу. Без мастера обновите новую группу правым кликом. -### 4. Добавьте пользователей в User Group +### 4. Добавьте пользователей в группу -На экране обновления группы откройте вкладку Users и добавьте пользователей, которым нужен Element. Дайте роль **не слабее** Member. Либо добавляйте пользователей в группу со страницы редактирования пользователя, вкладка Access Permission. +На экране группы откройте вкладку Users и добавьте пользователей, которым нужен элемент. Дайте роль **не слабее** Member. Или добавьте пользователя со страницы его редактирования, вкладка Access Permission. -### 5. Добавьте Element Category ACL +### 5. Добавьте ACL категории элемента -Откройте вкладку "Element Category Access". В Revolution 2.3.x она в боковой панели вкладки Permissions группы пользователей. +Откройте вкладку "Element Category Access". Она в панели группы, рядом с другими вкладками доступа. Нажмите "Add Category" над таблицей. Выберите: -- Category: ваша Category из шагов выше +- Category: категория из шагов выше - Minimum Role: Member - Access Policy: Element - Context: mgr - Нажмите "Save" в диалоге - Нажмите "Save" справа вверху -### 6. Flush Permissions +### 6. Перезагрузите права доступа -В верхнем меню: "Security -> Flush Permissions". В Revolution 2.3.x это Manage -> Logout All Users. +Откройте иконку замка → **Перезагрузить права доступа**, затем **Завершить все сеансы**. -Всех заставят войти снова. Element Category теперь защищена от пользователей вне группы Editors. +После этого все входят заново. Категория элемента закрыта от пользователей вне группы Editors. -## Скрытие конкретных Elements от части пользователей +## Скрытие отдельных элементов -Иногда нужно скрыть элементы от всех, кто не в группе Administrator. Положите элементы в категорию как выше, но привяжите её к группе Administrator: +Иногда нужно скрыть элементы от всех, кто не в группе Administrator. Положите элементы в категорию, как выше, и привяжите её к группе Administrator: -- Откройте редактирование группы Administrator (Security -> Access Controls -> User Groups -> правый клик по "Administrator" -> Update User Group). В Revolution 2.3.x это Access Control Lists в меню Admin (шестерёнка). +- Откройте редактирование группы Administrator (иконка замка в меню пользователя → **Контроль доступа** → вкладка **Группы пользователей & Пользователи** → правый клик по "Administrator" → **Редактировать группу пользователя**) - Откройте вкладку Element Category Access - Добавьте ACL через "Add Category": - - Category: ваша Category из шагов выше - - Minimum Role: admin Super User + - Category: категория из шагов выше + - Minimum Role: Super User - Access Policy: Element - Context: mgr - Нажмите "Save" в диалоге - Нажмите "Save" справа вверху +- В верхнем меню: **Завершить все сеансы** -- В верхнем меню: Security -> Flush All Sessions. В Revolution 2.3.x это Manage -> Logout All Users. +Теперь элементы видит только admin Super User. -Теперь Elements видит только admin Super User. +## Особый случай для Template -## Особый случай для Templates +Вы ограничили Template способом выше. Другая группа пользователей должна править ресурсы с этим Template, но не создавать их. Она должна видеть TV шаблона, хотя доступа к самому Template у неё нет. Эта группа (назовём её Editors) видит ресурс. В списке Template показан его ID, а TV не видны. Нужна ещё одна ACL на группу Editors, чтобы загружались Template и его TV. -Допустим, вы ограничили Template способом выше. Другой User Group без доступа к Template всё же должна править (но не создавать) Resources с этим Template и видеть TV шаблона. Сейчас вторая группа (назовём её Editors) видит Resource, в combobox Template показывает ID, но TV не видит. Нужна ещё одна ACL для группы Editors, чтобы загружались Template и связанные TV. - -- Откройте редактирование группы Editors (Security -> Access Controls -> User Groups -> правый клик по "Editors" -> Update User Group) +- Откройте редактирование группы Editors (иконка замка в меню пользователя → **Контроль доступа** → вкладка **Группы пользователей & Пользователи** → правый клик по "Editors" → **Редактировать группу пользователя**) - Откройте вкладку Element Category Access - Добавьте ACL через "Add Category": - - Category: ваша Category из шагов выше + - Category: категория из шагов выше - Minimum Role: Member - Access Policy: Load Only - Context: mgr - Нажмите "Save" в диалоге - Нажмите "Save" справа вверху +- Пользователи Editors выходят и входят снова, либо нажмите **Завершить все сеансы** в верхнем меню -- Пользователи Editors должны выйти и войти снова, либо Security -> Flush Sessions в верхнем меню - -Готово. Editors увидят и будут править TV для Template в защищённой Category. Пользователи вне Editors их не увидят. +Editors увидят и будут править TV для Template в защищённой категории. Template остаётся скрыт от пользователей не из группы Editors. ## Смотрите также -1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) -2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) -3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) -4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) -5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/security-tutorials/screen+shot+2012-10-19+at+11.43.46+pm.png b/ru/building-sites/client-proofing/security/security-tutorials/screen+shot+2012-10-19+at+11.43.46+pm.png new file mode 100644 index 000000000..4c2515dee Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/screen+shot+2012-10-19+at+11.43.46+pm.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/user+group_+anonymous.png b/ru/building-sites/client-proofing/security/security-tutorials/user+group_+anonymous.png new file mode 100644 index 000000000..7c88a74ca Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/user+group_+anonymous.png differ diff --git a/ru/building-sites/client-proofing/security/security-tutorials/user-group-perms.jpg b/ru/building-sites/client-proofing/security/security-tutorials/user-group-perms.jpg new file mode 100644 index 000000000..1ec378edb Binary files /dev/null and b/ru/building-sites/client-proofing/security/security-tutorials/user-group-perms.jpg differ diff --git a/ru/building-sites/client-proofing/security/troubleshooting-security/index.md b/ru/building-sites/client-proofing/security/troubleshooting-security/index.md index ad63e71e2..11d19712f 100644 --- a/ru/building-sites/client-proofing/security/troubleshooting-security/index.md +++ b/ru/building-sites/client-proofing/security/troubleshooting-security/index.md @@ -1,6 +1,7 @@ --- title: "Устранение проблем безопасности" translation: "building-sites/client-proofing/security/troubleshooting-security" +description: "Что проверить, если доступ в MODX работает не так, как ожидается." --- ## Устранение проблем безопасности diff --git a/ru/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md b/ru/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md index f0f21a982..4ed8edff0 100644 --- a/ru/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md +++ b/ru/building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually.md @@ -1,111 +1,75 @@ --- title: "Ручной сброс пароля пользователя" translation: "building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually" +description: "Сбросить пароль пользователя MODX, когда ссылка для восстановления не доходит: в базе или через API." --- ## Сброс пароля через правку базы данных -Бывает, что учётная запись недоступна из-за утерянного или забытого пароля. Часто помогает ссылка Forgot Password на форме входа. Иногда пароль нужно сбросить вручную прямо в базе. Нужен доступ к базе с таблицами MODX через PHPMyAdmin или другой клиент, где можно править или UPDATE записи. +Пусть пользователь откроет ссылку Forgot Password на форме входа. Если учётная запись всё ещё недоступна, сбросьте пароль в базе. Нужен клиент, в котором можно выполнить UPDATE. -### Сброс пароля в MODX 2.1+ +**Штатный хеш в базе не посчитать** +В MODX 3 пароль хранится классом `MODX\Revolution\Hashing\modNative`. Запросом к базе этот хеш не получить. -В MODX 2.1+ пользователи по умолчанию создаются с алгоритмом хеширования PBKDF2. В MySQL или SQL Server обычно нет функций для таких хешей. Поэтому при ручном сбросе в базе также смените hash\_class пользователя с hashing.modPBKDF2 на hashing.modMD5. Затем через родную функцию MD5() задайте значение поля password. Пример MySQL UPDATE: +Задайте полю `hash_class` пользователя класс `MODX\Revolution\Hashing\modMD5` и запишите пароль как MD5-хеш. В базе для этого есть функция `MD5()`. Выполните этот запрос. В имени таблицы стоит префикс вашей установки: -``` php -UPDATE modx_users SET hash_class = 'hashing.modMD5', password = MD5('the-new-password') WHERE username = 'theusername'; +``` sql +UPDATE modx_users SET hash_class = 'MODX\\Revolution\\Hashing\\modMD5', password = MD5('the-new-password') WHERE username = 'theusername'; ``` -Чтобы пароль потом снова автоматически перешёл на PBKDF2, установите [pbkdf2Convert Plugin](https://modx.com/extras/package/pbkdf2convert) из Package Management. - -### Сброс пароля в MODX 2.0.x - -В MODX 2.0.x достаточно записать в поле password валидный MD5-хеш прямо в таблице. Пример MySQL UPDATE по username: - -``` php -UPDATE modx_users SET password = MD5('the-new-password') WHERE username = 'theusername'; -``` +Пользователь сможет войти. Следующая смена пароля по-прежнему хеширует через `MODX\Revolution\Hashing\modMD5`. Чтобы вернуться к штатному хешеру, поставьте `hash_class` в `MODX\Revolution\Hashing\modNative` и после этого сохраните новый пароль в менеджере. Имя класса задаётся вместе с пространством имён. Старое имя без него работает только через устаревший псевдоним, который печатает предупреждение. ## Сброс пароля через API -Пароль (и любую часть приложения MODX) можно менять через API. Ниже пример скрипта: обновляет пароль и email пользователя и гарантирует членство в группе Administrator. +Скрипт задаёт новый пароль существующему пользователю. Пароль хешируется классом, который уже записан в `hash_class`. ``` php initialize('mgr'); -$query = $modx->newQuery('modUser'); -$query->where( array('username'=>$username) ); -$user = $modx->getObjectGraph('modUser', '{ "Profile":{}, "UserGroupMembers":{} }', $query); -// print_r($user); exit; +$user = $modx->getObject(\MODX\Revolution\modUser::class, ['username' => $username]); if (!$user) { - die("ERROR: No user with username $username"); + die('ERROR: Нет пользователя с таким именем.'); } -$user->set('username',$username); -$user->set('active',1); $user->set('password', $password); -$user->Profile->set('email', $email); -$user->Profile->set('blocked', 0); -$user->Profile->set('blockeduntil', 0); -$user->Profile->set('blockedafter', 0); - -// Verify the user is a member of specified User Group -$is_member = false; -if (!empty($user->UserGroupMembers)) { - foreach ($user->UserGroupMembers as $UserGroupMembers) { - if ($UserGroupMembers->get('user_group') == $user_group) { - $is_member = true; - break; - } - } -} -// Add the User to the User Group if he is not a member -if (!$is_member) { - // Verify the user group exists - $UserGroup = $modx->getObject('modUserGroup', $user_group); - if (!$UserGroup) { - die ("ERROR: User Group $user_group does not exist."); - } - - $Member = $modx->newObject('modUserGroupMember'); - $Member->set('user_group', $user_group); - $Member->set('member', $user->get('id')); - // Super User = role 2 - $Member->set('role', 2); - $Member->set('rank', 0); - $user->addOne($Member,'UserGroupMembers'); -} - -/* save user */ if (!$user->save()) { - die('ERROR: Could not save user.'); + die('ERROR: Не удалось сохранить пользователя.'); } -print "SUCCESS: User $username updated."; - -?> +echo 'SUCCESS: пароль обновлён.'; ``` -Скрипт можно положить в любое место на сервере, если обновить путь к основному **index.php**. Запускайте его из браузера или из командной строки. - -**Warning** -С таким скриптом будьте крайне осторожны. По возможности не кладите его внутрь document root. Держите его вне document root и запускайте из командной строки. +Положите скрипт в любое место на сервере и поправьте путь к основному **index.php**. Запускайте его из браузера или из командной строки. + +> [!WARNING] +> С таким скриптом будьте крайне осторожны. По возможности не кладите его внутрь document root. Держите его вне document root и запускайте из командной строки. + +## Смотрите также + +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) + 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) + 2. [ACL](building-sites/client-proofing/security/policies/acls) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) + 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/ug-ctx-grid1.png b/ru/building-sites/client-proofing/security/ug-ctx-grid1.png new file mode 100644 index 000000000..a1b130d9b Binary files /dev/null and b/ru/building-sites/client-proofing/security/ug-ctx-grid1.png differ diff --git a/ru/building-sites/client-proofing/security/ug-rg-grid1.png b/ru/building-sites/client-proofing/security/ug-rg-grid1.png new file mode 100644 index 000000000..3d51e04da Binary files /dev/null and b/ru/building-sites/client-proofing/security/ug-rg-grid1.png differ diff --git a/ru/building-sites/client-proofing/security/understanding-revo-acls.jpg b/ru/building-sites/client-proofing/security/understanding-revo-acls.jpg new file mode 100644 index 000000000..3b21f644a Binary files /dev/null and b/ru/building-sites/client-proofing/security/understanding-revo-acls.jpg differ diff --git a/ru/building-sites/client-proofing/security/user-groups.md b/ru/building-sites/client-proofing/security/user-groups.md index 3765d0e29..bb25cc01d 100644 --- a/ru/building-sites/client-proofing/security/user-groups.md +++ b/ru/building-sites/client-proofing/security/user-groups.md @@ -1,30 +1,30 @@ --- title: "Группы пользователей" translation: "building-sites/client-proofing/security/user-groups" +description: "Группы пользователей MODX: права, которые они несут, пять видов доступа и роли внутри группы." --- ## Что такое группа пользователей? Группы пользователей (User Groups) в MODX задают права доступа. В отличие от некоторых CMS, в MODX пользователь может входить в _несколько_ групп пользователей. -## Использование - Права в MODX выдают _группам пользователей_, а не отдельным пользователям. Поэтому пользователь должен состоять хотя бы в одной группе, чтобы иметь какие-либо права. Иначе говоря, что пользователь может и чего не может, зависит от его групп. В других CMS это иногда называют «ролью». -Чтобы править права группы, откройте Admin (значок шестерёнки) -> Access Control Lists, затем щёлкните правой кнопкой по существующей группе, чтобы обновить её, или создайте новую. +Чтобы править права группы, откройте иконку замка в меню пользователя → **Access Control Lists**, затем щёлкните правой кнопкой по существующей группе, чтобы обновить её, или создайте новую. -Группа пользователей может задавать доступ к четырём областям: +Группа пользователей может задавать доступ к пяти областям: - **Context Access** - доступ к менеджеру или к front-end порталу входа. - **Resource Group Access** - доступ к группе ресурсов. - **Element Category Access** - ограничение, например, только определёнными Chunks или только отдельными полями ресурса. - **Media Source Access** - ограничение доступа к папкам на файловой системе или к S3 buckets. +- **Namespace Access** - ограничение доступа к элементам пространства имён. ## Управление участниками -Добавлять и убирать пользователей из групп можно при редактировании пользователя (Manage -> Users): щёлкните правой кнопкой по пользователю и откройте вкладку "Access Permissions". +Добавлять и убирать пользователей из групп можно при редактировании пользователя (иконка замка в меню пользователя → **Users**): щёлкните правой кнопкой по пользователю и откройте вкладку "Access Permissions". -Другой способ: Admin -> Access Control Lists. Там дерево групп пользователей и их участников. Назначить пользователя в группу можно правым кликом по группе и далее: +Другой способ: иконка замка в меню пользователя → **Access Control Lists**. Там дерево групп пользователей и их участников. Назначить пользователя в группу можно правым кликом по группе и далее: - добавить пользователя через пункт контекстного меню - отредактировать группу и добавить пользователя в таблице @@ -53,6 +53,10 @@ translation: "building-sites/client-proofing/security/user-groups" Готово: доступ по роли. Эта ACL ограничит все ресурсы (документы) в контексте web и в группе ресурсов "TestResourceGroup4" только пользователями группы "HR Department" с ролью не слабее Supervisor. Роли с меньшим номером authority тоже получат доступ. Например, роль Coordinator с authority 2: пользователи этой группы тоже попадут под эту ACL. +### Права страницы + +Странице групп нужны права: `usergroup_view` — увидеть список, `usergroup_new` и `usergroup_save` — создать группу, `usergroup_edit` — изменить, `usergroup_delete` — удалить, `usergroup_user_list` — увидеть участников, `usergroup_user_edit` — добавить и убрать их. + ### Назначение групп и ролей через MODX API Работая с объектом modUser в MODX API, права можно назначать через modUser::[joinGroup](http://api.modx.com/revolution/2.1/_model_modx_moduser.class.html#%5CmodUser::joinGroup()). Этим методом вы добавляете пользователя напрямую в группу и при желании назначаете роль. @@ -69,22 +73,22 @@ if( $user ){ ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - политика Administrator](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - политика Resource](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Усиление защиты MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем безопасности](building-sites/client-proofing/security/troubleshooting-security) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) diff --git a/ru/building-sites/client-proofing/security/users.md b/ru/building-sites/client-proofing/security/users.md index 998a0a56a..82f6546b1 100644 --- a/ru/building-sites/client-proofing/security/users.md +++ b/ru/building-sites/client-proofing/security/users.md @@ -1,103 +1,135 @@ --- title: "Пользователи" translation: "building-sites/client-proofing/security/users" +description: "Пользователи MODX: их поля, флаг суперпользователя, настройки пользователя и свойства пользователя на сайте." --- ## Что такое пользователь? -Пользователь (User) в MODX Revolution это учётная запись для входа. +Пользователь это вход в MODX. -Пользователей можно включать в группы пользователей. К группам подключают [ACL](building-sites/client-proofing/security/policies/acls "ACL"), которые задают контроль доступа. +Пользователей назначают в группы пользователей. У групп есть [ACL](building-sites/client-proofing/security/policies/acls "ACL"), и они задают доступ. + +## Суперпользователь + +Поле `sudo` делает пользователя суперпользователем. Проверки политик для него не выполняются. Пользователь видит всё, что бы ни говорили ACL. + +Выдать этот флаг может только пользователь с правом `set_sudo`. Администратор свежей установки получает его. ## Настройки пользователя -Настройки пользователя (User Settings) в MODX Revolution автоматически перекрывают системные и контекстные настройки с тем же ключом для этого пользователя. Они могут быть и полностью уникальными. Порядок наследования настроек: +Настройка пользователя перекрывает настройку группы с тем же ключом. Настройка группы перекрывает настройку контекста. Настройка контекста перекрывает системную. Порядок такой: -`System Settings -> Context Settings -> User Settings` +`системная настройка → настройка контекста → настройка группы → настройка пользователя` -Чтобы править настройки пользователя, откройте **Security -> Manage Users -> Update User (_правый клик_) -> Settings (_вкладка_)** +Чтобы изменить настройки пользователя, откройте иконку замка → **Пользователи**, щёлкните пользователя правой кнопкой и выберите **Редактировать**, затем вкладку **Настройки**. -Пользовательские настройки доступны только _после_ создания пользователя. Вкладки "Settings" нет, пока вы только создаёте пользователя. +Менять эти настройки можно только после создания пользователя. На форме создания вкладки нет, и видит её только sudo. Войдите как sudo, чтобы править настройки пользователя. -## Пользователи на front-end +## Пользователи на сайте -Когда пользователь вошёл на front-end сайта, его username и ID доступны через такие [Properties](building-sites/properties-and-property-sets "Properties and Property Sets"): +Когда пользователь вошёл на сайт, его имя и ID доступны через следующие [свойства](building-sites/properties-and-property-sets "Свойства и наборы свойств"): ``` php -[[+modx.user.id]] - Prints the ID -[[+modx.user.username]] - Prints the username +[[+modx.user.id]] - Выводит ID +[[+modx.user.username]] - Выводит имя ``` -Если пользователь не вошёл, ID будет пустым, а Username будет "(anonymous)". +Если пользователь не вошёл, ID равен 0, а имя `anonymous`. -Начиная с MODX 2.4.0, имя пользователя по умолчанию задаётся в System Settings настройкой **default\_username**. +Имя по умолчанию задаёт настройка `default_username`. **Помните** -Важный нюанс: вход в _manager_ не означает вход на _web_ front-end. Пользовательские настройки и API-метод [getOption](extending-modx/xpdo/class-reference/xpdoobject/configuration-accessors/getoption "getOption") подчиняются тому же правилу. Если вы не вошли на front-end, цепочка **System Settings -> Context Settings -> User Settings** применяется не полностью. +Вход в _manager_ не выполняет вход на сайт, в контекст _web_. Если вы не вошли на сайт, цепочка **системная настройка → настройка контекста → настройка группы → настройка пользователя** применяется не полностью. [Код, который читает настройку](extending-modx/xpdo/class-reference/xpdoobject/configuration-accessors/getoption "getOption"), следует тому же разделению. ## Поля пользователя -У пользователя есть такие поля: - -| Name | Description | -| ------------ | ------------------------------------------------------------------------------------ | -| id | ID пользователя. | -| username | Имя пользователя. | -| password | Зашифрованный пароль. | -| active | 1 или 0. Если не active, пользователь не сможет войти. | -| remote\_key | Удалённый ключ пользователя для приложений удалённой аутентификации. | -| remote\_data | JSON-массив данных для приложений удалённой аутентификации. | - -К пользователю также привязан Profile со следующими полями: - -| Name | Description | -| ---------------- | ---------------------------------------------------------------------------------------------------- | -| internalKey | ID пользователя. | -| fullname | Полное имя. | -| email | Email. | -| phone | Телефон. | -| mobilephone | Мобильный телефон. | -| fax | Факс. | -| blocked | 1 или 0. Если blocked = true, пользователь не сможет войти. | -| blockeduntil | Timestamp: до этой даты вход запрещён. | -| blockedafter | Timestamp: после этой даты вход запрещён. | -| logincount | Число входов пользователя. | -| lastlogin | Время последнего входа. | -| thislogin | Время входа в текущей сессии. | -| failedlogincount | Число неудачных попыток входа с момента последнего успешного входа. | -| sessionid | ID сессии пользователя, связанный с таблицей сессий. | -| dob | Дата рождения. | -| gender | 0 - не указано, 1 - мужской, 2 - женский. | -| address | Физический адрес. | -| country | Страна. | -| city | Город. | -| zip | Почтовый индекс. | -| state | Штат или область. | -| photo | Необязательное поле для фото. В UI не используется. | -| comment | Необязательный комментарий о пользователе. | -| website | Сайт пользователя. | -| extended | JSON-массив для дополнительных полей пользователя. | +Пользователи содержат следующие поля: + +| Имя | Описание | +| --- | --- | +| id | ID пользователя. | +| username | Имя пользователя. | +| password | Зашифрованный пароль пользователя. | +| cachepwd | Кэшированный пароль пользователя. | +| class\_key | Класс пользователя. Пользователь производного класса наследует его поведение. | +| active | 1 или 0. Если не активно, пользователь не сможет войти. | +| remote\_key | Ключ внешнего пользователя для приложений внешней аутентификации. | +| remote\_data | JSON-массив данных для приложений внешней аутентификации. | +| hash\_class | Класс, которым хешируется пароль. В MODX 3 по умолчанию `MODX\Revolution\Hashing\modNative`. | +| salt | Соль, записанная у пользователя. Штатный хешер `modNative` эту колонку не использует. | +| primary\_group | Группа, из которой пользователь получает дашборд и права своей основной группы. | +| session\_stale | Устарела ли сессия пользователя. | +| sudo | Является ли пользователь суперпользователем. См. [Суперпользователь](#суперпользователь). | +| createdon | Дата создания пользователя. | + +К пользователю привязан профиль. В нём следующие поля: + +| Имя | Описание | +| --- | --- | +| internalKey | ID пользователя. | +| fullname | Полное имя пользователя. | +| email | Адрес почты пользователя. | +| phone | Номер телефона. | +| mobilephone | Номер мобильного телефона. | +| fax | Номер факса. | +| blocked | 1 или 0. Если включено, пользователь не сможет войти. | +| blockeduntil | Метка времени, до которой пользователь не сможет войти. | +| blockedafter | Метка времени, после которой пользователь не сможет войти. | +| logincount | Число входов пользователя. | +| lastlogin | Когда пользователь входил в последний раз. | +| thislogin | Когда пользователь вошёл в текущей сессии. | +| failedlogincount | Сколько раз вход не удался с последнего успешного. | +| sessionid | ID сессии пользователя. Устарело, будет удалено в 3.2. | +| dob | Дата рождения. | +| gender | 0: ни одного, 1: мужской, 2: женский. | +| address | Физический адрес. | +| country | Страна пользователя. | +| city | Город пользователя. | +| zip | Индекс или почтовый код пользователя. | +| state | Область или провинция пользователя. | +| photo | Путь к картинке пользователя. Она показывается в шапке менеджера и загружается через медиа-источник из настройки `photo_profile_source`. Если картинки нет и включена настройка `enable_gravatar`, используется Gravatar. | +| comment | Необязательное поле для комментариев о пользователе. | +| website | Сайт пользователя. | +| extended | JSON-массив для хранения дополнительных полей пользователя. | + +## Настройки учётных записей + +| Настройка | Что делает | +| --- | --- | +| `passwordless_activated` | Включает вход по волшебной ссылке. По умолчанию выключено. | +| `passwordless_expiration` | Время жизни волшебной ссылки, в секундах. По умолчанию 3600. | +| `password_min_length` | Минимальная длина пароля. По умолчанию 12. | +| `password_generated_length` | Длина пароля, который генерирует MODX. По умолчанию 16. | +| `allow_multiple_emails` | Может ли у пользователя быть несколько адресов. | +| `clean_phone_number` | Чистится ли номер телефона перед сохранением. | +| `default_username` | Имя пользователя, который не вошёл. По умолчанию `(anonymous)`. | +| `enable_gravatar` | Используется ли Gravatar, если у пользователя нет картинки. | +| `photo_profile_source` | Медиа-источник, из которого грузится картинка пользователя. | +| `unauthorized_page` | Страница, куда попадает пользователь без доступа. | +| `access_context_enabled` | Проверяется ли доступ к контексту вообще. | +| `access_resource_group_enabled` | Проверяется ли доступ к группе ресурсов вообще. | ## Получение пользователя через API -Текущего пользователя в API даёт ссылка $modx->user. Например, этот сниппет выводит username: +Текущий пользователь доступен в API как `$modx->user`. Этот сниппет выводит имя: ``` php return $modx->user->get('username'); ``` -Чтобы взять поля Profile, сначала получите объект modUserProfile через алиас Profile. Например, этот сниппет возвращает email: +Чтобы прочитать поля профиля, сначала получите объект `modUserProfile` через псевдоним Profile. Этот сниппет возвращает адрес почты: ``` php $profile = $modx->user->getOne('Profile'); return $profile ? $profile->get('email') : ''; ``` -Если пользователь не вошёл, $modx->user всё равно доступен как объект, но вернёт 0 как ID и (Anonymous) как username. +Если пользователь не вошёл, объект `$modx->user` всё равно доступен. Он вернёт ID `0` и имя `anonymous`. -### Работа с extended-полями +### Работа с дополнительными полями -Значения в поле extended приходят как массив. С ними можно работать так: +Значения поля `extended` возвращаются массивом: ``` php /* get the extended field named "color": */ @@ -112,23 +144,22 @@ $profile->save(); ## Смотрите также -1. [Пользователи](building-sites/client-proofing/security/users) -2. [Группы пользователей](building-sites/client-proofing/security/user-groups) -3. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) -4. [Роли](building-sites/client-proofing/security/roles) -5. [Политики](building-sites/client-proofing/security/policies) +1. [Безопасность (ACLs)](building-sites/client-proofing/security) +2. [Пользователи](building-sites/client-proofing/security/users) +3. [Группы пользователей](building-sites/client-proofing/security/user-groups) +4. [Группы ресурсов](building-sites/client-proofing/security/resource-groups) +5. [Роли](building-sites/client-proofing/security/roles) +6. [Политики](building-sites/client-proofing/security/policies) 1. [Разрешения](building-sites/client-proofing/security/policies/permissions) - 1. [Разрешения - политика Administrator](building-sites/client-proofing/security/policies/permissions/administrator-policy) - 2. [Разрешения - политика Resource](building-sites/client-proofing/security/policies/permissions/resource-policy) + 1. [Политика администратора](building-sites/client-proofing/security/policies/permissions/administrator-policy) + 2. [Ресурсная политика](building-sites/client-proofing/security/policies/permissions/resource-policy) 2. [ACL](building-sites/client-proofing/security/policies/acls) - 3. [PolicyTemplates](building-sites/client-proofing/security/policies/policytemplates) -6. [Уроки по безопасности](building-sites/client-proofing/security/security-tutorials) - 1. [Доступ пользователя к менеджеру](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) + 3. [Шаблоны политик](building-sites/client-proofing/security/policies/policytemplates) +7. [Учебники по безопасности](building-sites/client-proofing/security/security-tutorials) + 1. [Доступ менеджера](building-sites/client-proofing/security/security-tutorials/giving-a-user-manager-access) 2. [Страницы только для участников](building-sites/client-proofing/security/security-tutorials/making-member-only-pages) - 3. [Второй пользователь Super Admin](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) - 4. [Ограничение Element для пользователей](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) - 5. [Подробнее о группе Anonymous](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) -7. [Усиление защиты MODX Revolution](getting-started/maintenance/securing-modx) -8. [Устранение проблем безопасности](building-sites/client-proofing/security/troubleshooting-security) + 3. [Второй суперпользователь](building-sites/client-proofing/security/security-tutorials/creating-a-second-super-admin-user) + 4. [Ограничение элемента](building-sites/client-proofing/security/security-tutorials/restricting-an-element-from-users) + 5. [Об анонимном пользователе](building-sites/client-proofing/security/security-tutorials/more-on-the-anonymous-user-group) +8. [Диагностика безопасности](building-sites/client-proofing/security/troubleshooting-security) 1. [Ручной сброс пароля пользователя](building-sites/client-proofing/security/troubleshooting-security/resetting-a-user-password-manually) -9. [Расширение modUser](extending-modx/custom-users "Extending modUser")