Viewing ad tags via entity references doesn't work for anonymous users / guests.

CommentFileSizeAuthor
#4 entity_access_permissions-2856259-4.patch765 bytesAnonymous (not verified)
#2 2856259-allow-anyone-to-view-ad-tags.patch882 bytesmxh

Comments

mxh created an issue. See original summary.

mxh’s picture

StatusFileSize
new882 bytes

Added a patch which allows anyone to view ad tags.
This might be not the ideal solution yet. Maybe we could add a "status" property for ad tags or another permission handling?

mxh’s picture

Status: Active » Needs review
Anonymous’s picture

StatusFileSize
new765 bytes

Another option for this could be to use entity access permissions from the entity module.

I've added a patch that adds the few lines for that

Status: Needs review » Needs work

The last submitted patch, 4: entity_access_permissions-2856259-4.patch, failed testing.

mxh’s picture

Another option for this could be to use entity access permissions from the entity module.

Agree, this looks like the proper solution for this module.

damienmckenna’s picture

Status: Needs work » Reviewed & tested by the community

While using the Entity module to handle this is one approach, I think adding a whole extra module to fix this one small thing is a bit much.

Patch #2 works for me.

  • VladimirAus committed 83439c19 on 8.x-1.x authored by mxh
    Issue #2856259 by mxh, DamienMcKenna: Allow anyone to view ad tags
    
vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you! Commited! 🧁

  • VladimirAus committed 83439c19 on 2.0.x authored by mxh
    Issue #2856259 by mxh, DamienMcKenna: Allow anyone to view ad tags
    
vladimiraus’s picture

Status: Fixed » Postponed (maintainer needs more info)

I would revert this for now as it might have security implications.
Can we add more information on why would we need to show it to anonymous users?

  • VladimirAus committed a0c06fa7 on 8.x-1.x authored by mxh
    Issue #2856259 by mxh, VladimirAus, DamienMcKenna: Allow anyone to view...

  • VladimirAus committed a0c06fa7 on 2.0.x authored by mxh
    Issue #2856259 by mxh, VladimirAus, DamienMcKenna: Allow anyone to view...
thomas.frobieter’s picture

EDIT: Applied the patch, this issue doesn't seem to be related to our problem. Its about rendering the tag entity itself? However, sorry for the noise!

-------

In our case, we show ads in views. We add them right in the view-view template, inside the for loop, using drupal_block():

{{ drupal_block('dfp_ad:5868dc4d-67c9-44xb-aa69-00a58f4b9fb4') }}

This works well while logged in, but not when logged out.

We tried to use the regular way, using the block_id, but this does not work because of #3006458: DFP blocks are not rendered if used inside one of the twig tweak functions.