Views Published or Roles

Categories

Component ID

2674360

Component name

Views Published or Roles

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

576

Component created

Component changed

Component body

This Views Published or Roles module provides two filters.

Published or has role

Published or has role allows you to filter by published or by a role. In a perfect world you can add the Bypass content access control permission to a role and use the Published or admin filter to allow a role to view unpublished nodes. Problem is that there are cases that you don't want a role to permission to edit all nodes.

In my scenario I have the View Unpublished Module installed and I want a certain role to only be able to view unpublished nodes for one node type. This filter allows me to select that role to view unpublished.

Current user has roles

Current user has roles allows you to filter by the current user's (logged in user's) role. In most cases you will be okay using the Content: Author contextual filter but it requires a relationship to User from the author field. In some cases you need to look up current users roles without the relation.