Joomlatools Support Center

Hide a category dynamically based on user access to the files


On my site I have 3 user groups who have incremental access to files:
- Group A has access to files for group A only;
- Group B has access to files for group A and group B;
- Group C has access to files for group A, B and C.

I want to have a category structure that is based on themes of the content, not on access rights. Each category may contain files for a random combination of access groups. This works ok as long as access is set for individual files.

Now for the question I have: a category may not contain any files for access group A. If this is the case, then I would like to hide the category from users of user group A. As far as I know, the standard way to accomplish this would be to impose group B (or C) access to this category.

However, it is possible that the next day a file wil be added to the category which is accessible for user group A. I do not want to have to check access to the categories every time when a file is added, removed or updated.

Is it possible to hide an entire category, based dynamically on the access settings of alle individual files that are in the category?

I hope that it is clear what I want to accomplish.

Kind regards,
Frits Jongbloets


Posted 6 years ago by Johan Janssens Staff

Hi Frits, no I'm afraid DOCman 2 cannot do this. In DOCman 1.x we had a 'hide empty categories' setting. An empty category was a category that didn't contain any documents based on the users permissions.

For DOCman 1.x with the more limited permission system it was quite easy to figure out if a category was empty or not.

For DOCman 2.0 this is more complex due to the way the Joomla 2.5+ permission system works. Calculating if a category is empty is a quite unperformant operation and on sites with a lot of documents per category it could potentially slow the site down drastically.

So far we have not found a solution to properly solve this yet. We do have an internal ticket to work more on this for a next release.

I hope that helps to explain things and I will keep you posted on our progress on this.

There are 2 more comments in this ticket.
Subscribe or login to join the discussion!


System Information