Create Download from Front End - Permissions and Access

Creation of Uploads from the Front End

To allow a user to upload data to create a new Download is a regular feature with jDownloads.  One of the menu item types available with jDownload is 'Create Download' and this provides the basic mechanism as described in Create Download Menu Item.

Before setting up the menu however there are several other aspects involved and various decisions that need to be made early on.

A key question is “Will all 'uploaders' be able to automatically publish their upload, or will it need approval?”. This could mean we will need two classes of 'uploaders', one class that can automatically publish, and another class that cannot.  Another question is "Will the upload always be to a specific Category or will the 'uploader' be able to choose?".  This could mean having four classes but in this example we will just have two classes and allow every 'uploader' to be able to select the Category. As jDownloads fully supports  Joomla! Permissions and View Access then having two or more classes of 'uploaders' is straight forward.  These choices are selectable in the jDownloads User Grooup Settings as discussed later.

The first step is to use the Joomla User Manager to create the two User Groups.  In this example we will use group names 'uploader', for people who will be able to upload but not publish, and 'uploader-full' for those who can upload and publish a Download.

Whilst the groups could have in principle any parent it is usually best to create the two user groups with Registered as their parent.  This avoids unintended consequences such as an 'uploader' user being able to edit articles and similar if you use Editor or any higher level group.

To create a group just go to the Joomla! User Manager and select User Groups.  After doing that groups could look like that shown opposite.

The User Manager enables allocating individuals to the relevant group.  You might also require people to Register before they can download. So 'uploaders' would belong to both the Registered group and one of the 'uploader' groups.

Whatever group names and parents that you decide to use, the important aspect is to set the permissions on the Categories.  It is usually sufficient to just set the permissions in the top level categories as the permissions will automatically cascade from parent to child down the tree.  Before committing it is probably useful to see the explanation and examples in Controlled Access to Categories and Downloads.  Also bear in mind that if you select a user group parent other than Registered then you may inadvertently give the user edit or similar rights to articles and other items on your website.  Of course you could have a your user group with its own branch starting from Registered!

 CreDownloadACL05

If jDownloads was installed or updated from the 1.9 series initially using a beta release prior to jD 2.5.19 or 3.2.19 then it maybe useul to use the Permissons Reset tools.  See Using Permission Reset Tools for more details.

Also bear in mind that the Joomla! permissions also pass down the User Group Tree.  For example if someone is a member of the 'uploader-full' group then they will also be a member of the  Registered and Public groups as well.  The 'root' is the Public group.  This is also explained in Controlled Access to Categories and Downloads.

The next step is to create two Viewing Access Levels, one for each user group.  The reasons for this is so that when we create the menu items they will only appear for the appropriate user group menu item.  Here we will call the view levels 'Viewuploader' and  'ViewUploader-full' assigning user groups as illustrated opposite.

You could of course let the 'uploader-full' group have access to both menu items by simply adding the uploader group to the 'ViewUploader-full' Access level.

CreDownloadACL07AA  CreDownloadACL07BB
Whilst doing Joomla! related actions it is probably convenient to create the menu items at this point.  As shown opposite the key point is that the access is set up to only show the menu item to members of a specific group. CreDownloadACL08A CreDownloadACL08B
In the Menu Options tab set up the appropriate details CreDownloadACL09A CreDownloadACL09B
From the front end one or other of the menu items will only appear for users in the appropriate group, unless of course you decided to allow the uploader-full group have access to both menu items as noted earlier. CreDownloadACL10A CreDownloadACL10B

Having set up the Joomla! Side of things now look at the jDownload side.  Actually the  next thing to do is to check that the Joomla! Access allows Creation of Downloads.  The most flexible way of doing this is to use the Permission settings of the top level categories.  For each of these categories click on say 'uploader' then this will produce a view like the one opposite, which is a typical default setting.  The important point is that Create is allowed.  If it is not allowed then set the middle column entry for the group to 'allowed', then Save and you will be shown the net result.  Similarly check out the 'upload' group.  If Create permission does not exist for the relevant user group then uploads are impossible.

Remember to set the Ranking in User Groups Setting to an appropriate value, say 123 for the uploader group and 125 for the uploader-full group.  If a user belongs to more than one group jDownloads uses the group in that set which has the highest ranking to select the User Group Settings that should be used.  jDownloads does not use the Rank value to select which set of permissions apply, it is used to select which set of User Group Settings should be used.  This is significant for 'uploaders' as it is the User Group Settings that control the questions asked in the upload form. This is discussed below.

 CreDownloadACL11A

We are now done with this one time setup of the access but if you should find that some categories will not allow the user to upload into them then you will need to check and ensure the groups have create permission at each level in the chain.  If you originally set up the Public Access or the Registered Access to 'Download Allowed' then the defaults will have set the higher groups access in a suitable manner.

The next stage is configuring the jDownloads User Group Settings.  This maybe accessed from the jDownloads Control Panel.  Much of what is needed here is covered in detail in Introduction to User Group Settings (opens in new window or tab).

So rather than go through those details here we will look at some specific points.  Having gone to User Group Settings, selected say the uploader-full group then either click on the name or on the Change Settings button in the toolbar.  Then select the Group Creation/Editing Settings as illustrated opposite.

The 'May select a different Category' checkbox would normally be ticked.  The 'Publish new Downloads' checkbox could be ticked for the ' uploader-full' group but could perhaps left unticked for the 'uploader' group.  Note also that the Allowed File Types  text box would usually be edited so as to include more file types such as pdf, doc, docx, jpg, png and so on.

download11

The three coumns below, which appear as a single column further down in the Group Creation/Editing Settings, allow control over what questions are presented to 'uploader' groups.  The first two images below are the 'standard questions' whilst the third column controls the 'custom' questions.  How to set up custom questions will be dealt with in a separate atricle currently in preparation.

Title and category are mandatory, but of course the category could be preset.  The first column of checkboxes is checked if the question is to be asked. The second one, if present, makes the question mandatory.

Standard Questions

Additional Custom Fields

download12A download12B

download12C

ColinM June 2014, modified January 2015

 

  • Monday, 02 June 2014