Downloads by User
Permissions and setup for individual user Downloads.
This example is for a situation where you wish to allow individual users to only be able to view and download their 'own' Downloads.
The scene in this simple illustration is that Downloads are created by an authorised user who assigns a "created by" User name to the Download. All the Downloads could be in a single category or in multiple categories or sub categories as may be desired. In this example we assume all the Downloads are in a single category.
Here we will assume the Authorised User has Front End access but it could also be from Backend Access. And for convenience we will assign this Authorised User to a User Group (UG) called 'uploader'.
First we will create the infrastructure which is a one time operation.
The initial steps will be to create the front end uploader capability.
First we create the User Group 'uploader' with Registered as its parent.
We also have to create the "authorised" user or users allowed to upload and assign them to the 'uploader' UG.
Of course the "regular" users who will be able to download their 'own' Downloads will also need to be created and added to the Registered UG. This is the default for Joomla!
Next create a new View Access Level called say 'Uploader-view'. The purpose of this will be come apparent later.
Now go to the User Groups Settings and select the uploader UG.
Set the Ranking level to a high value such as 133. This will ensure that the User Groups Settings in 'uploader' will be used by everybody who is allowed to upload.
In the Group Creation/Editing Settings tab ensure you set the allowed file types. Also set the preview audio and video file types.
It will be useful to force the setting of the Default View access for any Download to be Registered.
This means that Public users will not see the Download, and of course your 'uploader' cannot forget.
There are many other choices which you may or may not wish your uploader to be able to set.
Normally one would set the 'tick box' settings Created By so that the uploader may select the appropriate user as the Creator. However if users are to be able to create thier own Downloads then untick the Created by tick box. jD will then use the current user as the Creator.
The next step is to create the top level Category which will hold all the Downloads.
The picture opposite show the status after just setting the name of the category, in this example User Downloads, and then immediately doing a Save.
Because we did not select any parent category it automatically becomes a Top Level Category.
Note that the Access is Registered.
Remember that we will want the Uploader UG to be able to upload the Downloads and the regular Registered users to only be able to see and download their Downloads.
So the next activity will be to set the permissions.
The initial step is to goto the jDownloads Control Panel and select Options on the Tool Bar
This will bring up what are referred to as the 'Component Permissions'. Ensure all the 'Select New Settings' are set to Inherited, then save and close.
At this point no one, except, Super Users, should be allowed to Download. You may also want to reset the permissions of any existing Categories and Downloads by using the relevant Commands in the Tools Panel.
So after clearing the Options select the target Category, User Downloads in this example.
Then click on the Premissions Tab.
Select the Registered UG and the change the Download Permission to Allowed. Click on Save and the click again on the Permissions Tab.
You should see that the red in the Calculated Settings for Registered UG is now a green .
This permission setting will now allow the Regular Registered users to Download.
We now need to set up the Uploader UG permisions. Select the uploader UG. You should see the green alongside the Download permission because it has been inherited from it Parent, the Registered UG.
Change the Create and Edit Permissions to Allowed. You may or may not wish to allow the Uploader to Delete the entire Download. If so then also change the Delete permission. Note Edit permission allows deleting and reloasding the actual file to be downloaded so for most purposes only Create and Edit permissions are nedded.
When you have set the relevant permissions then Save. If you look at. the permissions again you should find the green in the relevant places.
The Permissions are now set up and we are nearly there!
The next stage is to create the relevant Menu Items. First we will create the one for the Registered Users.
This is the key step as jDownloads has a menu item 'List My Downloads'.
Clicking on this menu item causes jDownloads to search the entire set of Downloads to find those Downloads which have a Creator Name matching the Users Name.
The Access should be set to Registered so that Public Users cannot see the Menu item.
The final infrastructure step is to create the Menu Item for the Uploader.
This time select the Create Download menu item and set the Access to Uploader-view.
This ensures that only the members of the uploaders UG will see this menu item.
Now we can create our Downloads for each of the users. They have to be done individually as it is vital to set the Creator.
As noted above if you wish the current user to be set as the creator automatically then then untick the Created by tick box in the Group Creation/Editing Settings tab. The Created by question will then not be asked.
When a user logs in and uses the My Downloads menu item then they will see their own Downloads.
In this example there was only one Download.
Colin Mercer March 2016, modified Aug 2019