I have this problem or situation that I want to show K2 category/categories only to a user who is assigned to the specific category, if a user is logged in. Right now it will display all the categories even if the user is logged in or not, and can add items/articles to a specific category assigned to it if he/she's logged in which works as expected. Does anyone here knows how to solve it? Or any suggestions how can I make it work? Any help will be much appreciated. Joomla 3.3.6 K2 v2.6.7
If you can code then create a plugin in which
maintain mapping of k2 usergroup with allowed k2 categories
catch onAfterRoute trigger and add your code to check the k2 usergroup of user and its allowed k2 category.
function onAfterRoute()
{
$user = JFactory::getUser();
$groups = $user->groups;
$jinput = JFactory::getApplication()->input;
$option = $jinput->get('option', '');
$view = $jinput->get('view', '');
$task = $jinput->get('task', '');
// place k2-USER-GROUP related checking here
}
I am not sure about the view, task and other variables which k2 adds in the url while displaying category in front-end so you need to check this first.