Keyword

Restricting users to be able to view only their own articles

  • Tobias West
  • Tobias West's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90535 by Tobias West
Hi All, I have been using K2 for a few weeks now and so far, really pleased with it and it can do everything I ask it to, except for one thing which, so far I am unable to find a solution for. The scenario I have is, for a particular category I wish to restrict users from being able to view any articles in this category unless they are the creator - is there a way to do this through code or an extension?Any pointers would be really good, Many Thanks in advance

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #90536 by william white
You can do accomplish that by creating an override and assigning it to the k2 category in question.
see simon.getk2.org/component/k2/item/91-templating and community.getk2.org/notes/Templating_in_K2 for more info on creating them.
After you have created the override for the category, you will have to edit the new item.php and/or the category_item.php depending on the circumstances and put in a test for the user with a php if statement to only show these articles to the owner of them, and of course the administrators.

Please Log in or Create an account to join the conversation.

  • Tobias West
  • Tobias West's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #90537 by Tobias West
Thank you William, I've tried this with a simple 'Hello World' echo and it works, now I just need to implement this to the whole article and the rest of the pages within the template, so I think I have everything I need to get cracking with this.

Many thanks again & all the best

Tobias

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum