- Issue created by @james.williams
- 🇬🇧United Kingdom james.williams
I wonder if someone could review this. Credits available!
- 🇬🇧United Kingdom james.williams
FWIW, this is what Gemini suggested to me after I had opened the MR:
# Autocreate Access --- ## Overview The Autocreate Access module enhances the functionality of **autocomplete entity reference field widgets** (commonly seen with 'tags style' fields for taxonomy terms) by ensuring that **entity creation permissions are respected**. By default, if an entity reference field is configured to allow new entity creation via an autocomplete widget, any user might be able to create new entities on the fly, regardless of their specific "create" permissions for that entity type or bundle. This can lead to scenarios where users with limited privileges inadvertently or intentionally create new entities (like taxonomy terms), bypassing intended content governance. Autocreate Access solves this by **enforcing existing Drupal permissions**. It ensures that a user can only create a new entity through an autocomplete widget if they have the necessary "create [entity type]" or "create [entity bundle] content" permission. This allows site administrators to grant specific user roles the ability to create new entities on the fly, while restricting less-privileged users to only selecting existing entities. --- ## Features * **Respects existing Drupal permissions:** Integrates seamlessly with Drupal's core permission system for entity creation. * **Granular control:** Enables fine-grained control over which user roles can create new entities via autocomplete fields. * **Prevents unintended creation:** Stops less-privileged users from creating new entities on the fly when they should only be selecting existing ones. * **Supports all entity types:** Works with any entity type that uses an entity reference field with an autocomplete widget. * **No configuration needed:** The module works out-of-the-box by leveraging existing permissions, requiring no additional configuration pages. --- ## Requirements This module requires: * Drupal core 9.x or 10.x (specific versions supported will be listed on the module's project page). --- ## Installation 1. **Download the module:** Use Composer (recommended): ```bash composer require drupal/autocreate_access ``` Or download the tar.gz or zip file from the [Autocreate Access project page](https://www.drupal.org/project/autocreate_access) and place it in your modules directory (e.g., `web/modules/contrib`). 2. **Enable the module:** Using Drush: ```bash drush en autocreate_access ``` Or manually through the Drupal admin interface: Navigate to `Extend` (`/admin/modules`), search for "Autocreate Access", and enable it. --- ## Configuration The Autocreate Access module **requires no specific configuration**. Once enabled, it automatically integrates with Drupal's entity reference autocomplete fields and respects your existing user role permissions for entity creation. To control which roles can create new entities via autocomplete, simply manage the standard Drupal permissions for "create [entity type]" (e.g., "create taxonomy terms") or "create [entity bundle] content" (e.g., "create Article content") at `admin/people/permissions`. --- ## Usage Once installed and enabled, the module operates automatically: 1. Ensure you have an **entity reference field** configured with an **autocomplete widget** (e.g., a "Tags" field for taxonomy terms). 2. Go to `admin/people/permissions`. 3. For any user role, grant or revoke the relevant **"create [entity type]"** (e.g., "create taxonomy terms") or **"create [entity bundle] content"** (e.g., "create Basic page content") permission. 4. Users with the "create" permission for the referenced entity type/bundle will be able to create new entities directly from the autocomplete field. 5. Users *without* that specific "create" permission will **only be able to select existing entities** from the autocomplete suggestions; they will not be able to create new ones on the fly. --- ## Maintainers * [Your Drupal.org username(s)] (e.g., `johndoe`) - [Link to your Drupal.org profile(s)] (e.g., `https://www.drupal.org/u/johndoe`) --- ## Credits Special thanks to [any individuals or organizations if applicable]. --- ## License This project is licensed under the GNU General Public License, version 2 or later. ---
- 🇬🇧United Kingdom james.williams
So.much.waffle. Or should that be soup? Some of it isn't even true, like "No configuration needed" 🤔
- 🇬🇧United Kingdom rossb89 Bristol
The screenshot referenced in the
Configuration
section shows a 'Reference Method' but there is no mention about this in the Configuration section.If this is something that is configurable, I think it would sense to detail to any potential users of the module about this? Or if it can be safely ignored, mention that as well?
What do you think?
- 🇬🇧United Kingdom rossb89 Bristol
Ok great, thanks for making that change... I think the readme is clear and succinct and covers all the bases for now!
-
james.williams →
committed cb41e70c on 1.0.x
Issue #3529842 by james.williams, rossb89: Add Readme.md file
-
james.williams →
committed cb41e70c on 1.0.x