Problem/Motivation

We don't allow our editors to see the usage tab. We do want them to be able to see the usage in a view we built. This will add a permission check to see if the current user has the "Access entity usage statistics" perms when creating the link. If they don't it will just return the count without the link.

Command icon 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

edmund.dunn created an issue. See original summary.

edmund.dunn’s picture

Attached the patch with changes. Checked permissions for the current user and then rendered the count alone or the count as a link to the entities usage tab.

edmund.dunn’s picture

Status: Active » Needs review

malcomio made their first commit to this issue’s fork.

  • malcomio committed da410cce on 2.x
    #3443270 Check 'Access entity usage statistics' perms in linkedUsage()...
malcomio’s picture

Status: Needs review » Fixed

Thanks

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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