0

I want to create the view where content of specific type will be visible according to given permission for current user's role.

For Example:I have created a role and given it the permission for create, edit ,delete Article Content Type. so the view should display all the nodes for article. This should be applicable on multiple content types also.

Summary : View should display only nodes for which user has permission for create,edit,delete.

  • Access control for a content normally automatically checked in the views, including the grants hook's access too (node access), but only for node, if you have custom entities, than you need to write the compatibility for those entities. For the edit/delete link you need to use the operations field if I remember well, because that's also dynamic. If you simply put out edit button/link field, it will displayed if it has access and it doesn't. (as far as I remember now) – golddragon007 Dec 19 '18 at 12:20
  • @golddragon007 Agree, but i want to display specific content type data according to permission for current user's role. – amol Dec 21 '18 at 12:24
  • could you provide an example, what you want to reach, because I think you are covered with the views without any custom code. Because i.e. if the user doesn't have view permission for a specific content type it won't list anything the views... and I have no idea why I can't mention you... – golddragon007 Dec 21 '18 at 12:40
0

Create your view, in middle column, in Permissions: View Published Contentclick on it and select Role. Specify the role you want.

  • 1
    He asking per content permission check, not for who can view my view permission. – golddragon007 Dec 19 '18 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.