drupal-8drupal-viewsdrupal-contextual-filters

Role based access control on view nodes in drupal 8


Could any one help me on how to filter a view’s node list based on the user role? For example, consider we have manager and developer roles and there are 3 node items in a view that are node1,node2,node3.Manager has access to node1, node2 & the developer has access to node3.Now,the view should show only node1,node2 when the manager logs in and sees the view.And when the developer logs in,he should be able to see only node3.Thanks in advance


Solution

  • I achieved RBAC using the node_check_access hook by creating a new custom module