Deleting Downloads from Frontend and Permissions

Written on .

A Download consists of many parts, the foremost of these is of course the file that is to be downloaded.  Other parts comprise items like descriptions, images and thumbnails, and previews.
In order to create a Download from the front end the dominant user group to which the user belongs must have Create permission.  Similarly to Edit requires Edit permission, or in appropriate circumstances, Edit Own permission.  Similarly to delete the user group must have Delete permission.  By dominant user group I mean that of all the user groups to which the user belongs the one with the highest ranking is the 'dominant' user group.  Also be aware that if the user is a member of a group that has say Author as its Parent then the user is also a member of the Author, Registered and Public groups.  Each of these has a group ranking within jDownloads so make sure the particular group intended as the dominant one 'outranks' the implied members.
The following example uses user group uploaderUG and a Download called 'Transmission loss system'
Suppose the permissions for the Download are as shown opposite.

Note generally the permissions to 'Allow' are set in a category at a higher level in the category - sub category - sub sub categeory, ... , Download chain.

In most cases the permissions are set in the top level categories. 

As a result Downloads usually just 'Inherit' permissions.
Delete download25z
When this Download is shown then the 'pencil' symbol appears indicating that the Download is at least capable of being editted.Delete download25A
Similarly in this case the Add button and 'Add' appear in the top bar indicating the Download has Create permission.Delete download25B
So after clicking on the 'pencil' then the Download edit form will be shown.

Note that it is possible to delete the downloadable file by using the Delete download button01 button.  This allows the file to be replaced with another one, which might be for example an updated version.  Delete permission is not required as changing the downloadable file is an editing function

Also the file may be renamed by using the Delete download button02 button.

Note also that if a preview file has been added to the Download then the Delete download button01 and  Delete download button02 buttons will appear there as well.
Delete download25C
Suppose now that the Delete Permission is added.  Note that Delete permission is rarely required in the frontend as all parts of a Download may be changed individually with just Edit permission. 

And of course the Download may be deleted from the backend.

After Delete permission has been granted then a 'Delete' button appears at the top of the edit form as shown opposite. 
Or putting it another way, if you cannot see the delete button then the download does not have delete permission for the user group.

On successfully deleting the entire Download, a message such as the one opposite is shown.
Delete download25DDelete download25xDelete download25F
In some situations not all information about the Download is deleted.  The images and preview files may be retained depending on the settings of the two parameters that are in the Global Settings tab of the Options. The default setting for both of these is No.Delete download25G
Note that no knowledge of these files is retained in the database so if you set them to 'No' then there will be a lot of files retained in directory <site>/images/jdownloads/screenshots and its sub-directory thumbnails.
However you can use the Tools options Delete download images and Delete download preview as these delete those images and preview files that are unallocated.
ColinM, March 2020