I added the entity button to the view field for "No results behavior".

I added it to a view and a block.

the content type can only be added by an authenticated user.

When the block was visible to anonymous users, the link/button was visible.

When it was clicked, there was a no access message.

Is there a way to check if the user has permission before rendering the button link?

Comments

SocialNicheGuru created an issue. See original summary.

laboratory.mike’s picture

Status: Active » Postponed (maintainer needs more info)
Related issues: +#3048596: Conditional hiding /disabling

The module should check for access before rendering the button, so there might be a settings issue, otherwise we have a bug. If you don't mind, could you provide the following for me?

- The current version of the module you are using
- If it is the dev version (which has code for #3048596: Conditional hiding /disabling), which plugins did you pick?
- Which entity type are you rendering a button for? I'm guessing nodes/content, but would like to confirm.

I can investigate from there.

laboratory.mike’s picture

Status: Postponed (maintainer needs more info) » Fixed

OK, after some review, I decided to add a checkAccess() method to the three entity default plugins, ViewsAccessButtonNode, ViewsAccessButtonUser, and ViewsAccessButtonTaxonomy. I tried it on my local and I see that users without create permissions are not seeing the link. I am including this as a part of the 8.x-1.1 release.

Let me know if you need anything else, after you download/try version 1.1.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.