Closed (duplicate)
Project:
Domain
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2023 at 15:02 UTC
Updated:
20 Aug 2025 at 17:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
heyyo commentedComment #3
agentrickardCan you please post an example -- or even better a test -- that shows this behavior?
At the very least I need a bullet list of steps to reproduce.
Comment #4
tim-dielsUse case 1:
An example would be adding the domain access field to a view like the content overview.
User 1 has bypass so that user can see the assigned domains of the content.
Another user that does not have the 'view domain list' will not see the assigned domains in the content overview.
Use case 2:
Add the module Domain Menu Access with the patch from #3120030: Show selected domains for each menulink on the menu edit page.
This will add a column "Domains" to the menu edit screen.
User 1 has bypass so that user can see the assigned domains of the content.
Another user that does not have the 'view domain list' will not see the assigned domains in the overview.
Some more information about the permission:
The check is done in
DomainAccessControlHandler->checkAccessI'm not sure what the permission does in general so not really an idea on how to create a test for this.
It's also used in
DomainListCheck->viewDomainListwhich gives access to/admin/config/domainMy guess is that giving this permission to non admin users is not a wanted behaviour, so we should see if there could be another way to allow to view the domain access field values.
Comment #5
tim-dielsSeems like there is some work done in #3254227: Permission for viewing active domains to provide this. But guess this needs some more explanation and maybe test coverage?
Comment #6
tim-dielsComment #7
agentrickardI don't think this is a current bug. I think it's a feature. The logic here is that domain information should not be shown to people who cannot act on it. See the Domain Content module for the core use-case.
That said, I think we can update #3254227: Permission for viewing active domains in this issue and create a special permission for it.
It's a little interesting that the other patch adds a "view active domains" permission. By design, that shouldn't be needed if the domain status is TRUE.
I think this is a special case for how Views interacts with the data. Our current permission rules are about restricting access to the full entity.
The test would add the field to the default "content" overview field and check that it is visible. Ideally, we'd write a failing test first.
Comment #9
makbay commentedComing from #3254227: Permission for viewing active domains and I have closed it in favor of this issue.
Well, actually in my case, we have an entity reference field referencing to domain entities in a content type. While using this field in a view to create a link to the referenced domain, non-admin users is not allowed to see the link or referenced domain entity. Please see the image below.
Comment #12
makbay commentedComment #13
agentrickardStill very interesting....this really needs a test, since we are adding a permission behavior.
Comment #14
leksat commentedSnapshot of MR 42 for using with Composer patches.
Comment #15
drpldrp commentedI have a similar use case and solved it by enabling the "view label" operation in DomainAccessControlHandler.
I also found it useful to implement toUrl() for the Domain entity.
Just a suggestion and for consideration.
Comment #17
mably commentedWhy do we have two MRs here?
And could we have a small test added please?
And we should be ready for merge.
Comment #18
mably commentedShould be solved by issue #3461900: Permission allows access to view domain entity.
Feel free to reopen if necessary.