• We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Resolved Admin cannot download resources

ParallelMC

New Member
Joined
Dec 30, 2017
Messages
14
Admin users, even with the proper permissions, cannot download premium resources without giving themselves a license.

4161
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
4,160
You mean if the download without buying permission is set ?
 

ParallelMC

New Member
Joined
Dec 30, 2017
Messages
14
I mean, the administrator has all permissions, including the permission to download without actually buying the resource. However, when he/she clicks on download, it gives the error as shown above. The admin has to go to the dashboard and give himself the license to the resource in order to download it.

This should not be the case as the admin should be able to download without having to give himself a license.
 

trakiss

New Member
Joined
Mar 29, 2019
Messages
6
@MtoR you don't check this permission everywhere ! This feature is just not implemented in ResourceVersion...
And probably a bug if the owner of a resource try to download this own resource.

To fix it @ParallelMC , in the entity ResourceVersion, in method canDownload():

replace

Code:
        /* If resource owner, download allowed */
        if ($resource->user_id == \XF::visitor()->user_id)
        {
            return true;
        }
by

Code:
       $visitor = \XF::visitor();

        /* If user is author or user can download without buying download is authorized */
        if ($resource->Category->canDownloadWithoutBuying($error)
            || ($visitor->user_id && $resource->user_id == $visitor->user_id))
        {
            return true;
        }
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
4,160
No I forgot that bug :D

I'll fix that, thanks for pointing out the problem.
 

thienbui

New Member
Joined
Jun 20, 2016
Messages
21
same problem above, no have version update fix?
Need manual repair as above?
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
4,160
Nope have to release a version to fix that.
 

MtoR

Freaky Coder
Staff member
Joined
Nov 14, 2015
Messages
4,160
If you did the manual code modification it's normal.
 

thienbui

New Member
Joined
Jun 20, 2016
Messages
21
Because of that, there's an updats fix.
very annoying to always see red messages in Admincp

Or is there another way to edit it?
 

thienbui

New Member
Joined
Jun 20, 2016
Messages
21
How can hide PURCHASES with customers.
Screen Shot 2019-09-06 at 7.45.46 AM.jpg


It inadvertently makes the buyer think the link is broken and they have responded.


Screen Shot 2019-09-06 at 7.45.40 AM.jpg

example:
Screen Shot 2019-09-06 at 7.50.26 AM.jpg


Thanks