News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Issue with category permisions

Started by EnElBajio, 02.07.2017 23:46:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EnElBajio

Hi,

I have installed JDownloads 3.2.52 in Joomla 3.7.2. I have set a some categories as follows:

- Joomla Extensions (en-GB language)
- - Vertical Markets (en-GB language)
- - - Booking & Reservations (en-GB language)
- Extensiones para Joomla (es-ES language)

I want to registered members are able to upload only in the sub-sub-category level, so I:

* verified that the component permissions are set to deny on create for registered
* verified the same for the category and sub-category
* set the sub-sub-category to allow create for registered.

The problem is that setting the sub-sub-category (Booking & Reservations) permission to allow on create, automatically allows creation in all other categories and sub-categories, even the "Extensiones para Joomla" that is out of the tree.

What am i missing? Please advice.

[gelöscht durch Administrator]
  •  

EnElBajio

I checked the code and I understood that although the add link appears in all the categories, the download can be only asigned to the ones with create permision and user must select the right category.

However, if the user choose to add a link in a category that has the create permission enabled, then the category is automatically selected.

To make it easier for users and let them add a download only when they are viewing an authorized category, I made the following customizations:

File: joomla_root/components/com_jdownloads/views/categories/view.html.php
- commented lines 55-70

File: joomla_root/components/com_jdownloads/views/category/view.html.php
- in the condition at line 69, I added  && in_array($category->id,$this->authorised_cats)

Is there a better way to achieve this? Thanks in advance for any comments.
  •  

ColinM

Hi
There should be no reason to modify the code to achieve what you want! :)

First in jD Config - User Groups Settings tab - Group Creation/Editing Settings panel (on right hand side) untick field 'May select a different Category' for the Registered User Group.

Next Set the Permissions for Sub Category 'Booking & Reservations (en-GB language)' for the Registered User Group to Allowed for Create and if you want the person to be able to only edit the Downloads they created then also set Edit Own to Allowed.  Do a Save and recheck permissions are as required.

Now any Registered user may create from the front end may create but the Category will Not be selectable (Note: If you subsequently create sub cats to 'Booking & Reservations (en-GB language)' then they will be able to select one of those sub cats as well.)
Using Edit Own limits the edit permission to the specific user who created the Download (Note: The super user can change the creator if they want to so do).

This has done what you need.  Three is more below which you might consider as well.

I presume you have chosen Registered for the default upload UG because it is the default UG when you give someone login permission.  However an alternative is to create your own 'uploader' UG with Registered as its Parent Ug, and then customise the jD User Groups Settings settings of 'uploader', including setting its Ranking to say 124, as you need.  Then in Joomla! Manage Users select the options button and change the default UG to uploader.  Why do this? Because any usaer in the Author, Edit or Publisher UGs will inherit the permissions in the Registered UG.  This is the case when you may have other users who create/edit/publish articles from the front end and you do not want them to be able to create Downloads. But if some do need that then join them to 'uploader' UG.

Colin


Colin M
  •