Problem/Motivation
Currently, domain_entity_entity_create_access checks domain entity create access permission even for entity types that are not enabled for domain access checks.
Steps to reproduce
1. With the superadmin user, go to /admin/people/role-settings and set it to none
2. Install the domain_entity module.
3. Add a domain record on /admin/config/domain
4. Create a user with an admin role and set "Domain Access" to the domain created in step 3.
5. Add permission "Create any content on assigned domains" to the administrator. NOTE: "Administer users" permission should still be unchecked.
6. Log in with those created users.
7. Open /admin/people/create
Proposed resolution
Return AccessResult::neutral() in case the target entity type is not enabled in: domain_entity_allowed_entity_types
Additionally
Check that similar behaviour exists on domain_entity_entity_access update/delete operation
| Comment | File | Size | Author |
|---|
Issue fork domain_entity-3582780
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
vitaliyb98 commentedComment #4
vitaliyb98 commentedNOTE: failed pipelines were fixed in: https://www.drupal.org/project/domain_entity/issues/3570727#comment-1652...
Comment #5
vitaliyb98 commentedIMHO: If a user has the
"Create any content on assigned domains"permission, they can create entities within their assigned domains even without the"Administer users"permission.While this behavior is expected, it would be helpful to document it clearly in the module documentation or on the project page, as it may not be obvious to users.
Comment #6
hfernandes commentedHi @vitaliyb98,
I can confirm this patch is working. A Content Editor without the "Administer User" permission isn't able to access the
/admin/people/create.Before:


After:
Regarding your comment about the
"Create any content on assigned domains"permission, since the Domain module defines this permission and it only grants access to node content (seeDomainAccessNodeHooks.php), I don't think we can use it to bypass access checks for other entity types in this module.Comment #7
hfernandes commentedComment #9
bohartComment #11
bohartThis one has been merged into a brand-new 2.0.x-dev branch, and will be part of the next release.
Marked as fixed, thanks!
Comment #13
andypostMakes sense to create new release
Comment #14
bohart@andypost, yes, and this is our plan for the next week!
We have already cleaned up about 50% of the outdated issues and merge requests, and reviewed/tested/committed RTBC ones.
The plan is to finish the cleanup, retest everything, and release a new version of the module.