I have some content of content-type "mockup". The "mockup" content-type has a field that references a user (so when I create a mockup, I can select a user for it to "belong" to).

For some reason, I can't figure out how to use views to get all "mockups" that belong to the logged in user. I thought it would be in "contextual" but I don't see anything like that.

I don't want anyone to be able to view the node unless they are the "related user", is this a "views" thing or a "permissions" thing?


I'm not sure about the details of your use case, but it might be easier to set the author of the node to the user rather than setting up a field with a reference.

You can set the author manually if you have administrator permissions. You could also use the Rules module (via the "Set a data value" action) to do so automatically.

If you use this method, you can simply set the permissions for "View own content of type ABC" and "View all content of type ABC" that are provided by default to limit access.

For your view, you can add a "Contextual filter" of "Author".


You can do this in many ways. One of them is to set a contextual filter Content: Author uid . You can also add relationship to add more information. You can also give the access permission as per specific role.

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.