1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

As Designed Not possible to rate when no download-permission

Discussion in 'Resource Manager Resolved Bugs' started by bart, Feb 5, 2014.

  1. bart

    bart Active Member

    When you don't use the download-function in the RM.

    When you set a permission to download to "no" (not set).

    And set the option "Require Downloading Before Rating" to "no".

    Then you should be able to rate a resource, but you're not.

    I traced the error to:

    Code:
        public function canRateResourceIfDownloaded(array $resource, array $category, &$errorPhraseKey = '', array $viewingUser = null, array $categoryPermissions = null)
        {
            $this->standardizeViewingUserReferenceForCategory($category, $viewingUser, $categoryPermissions);
    
            if ($resource['resource_state'] != 'visible')
            {
                return false;
            }
    
            if (!$viewingUser['user_id'])
            {
                return false;
            }
    
            if ($viewingUser['user_id'] == $resource['user_id'])
            {
                return false;
            }
    
            if (!$this->canDownloadResource($resource, $category, $null, $viewingUser, $categoryPermissions))
            {
    
    !!!
    
    if "requireDownloadToRate" is false, then this function should be bypassed.
    
    !!!
    
    
                return false;
            }
    
            return XenForo_Permission::hasContentPermission($categoryPermissions, 'rate');
        }
    
     
  2. Mike

    Mike XenForo Developer Staff Member

    First off, at the very least, I don't think this should change for backwards compatibility reasons. This is a pretty big change as you would suddenly potentially have people rating that weren't able to before.

    But further, while I understand what you want, I don't think it completely makes sense. Why should someone be able to rate/review a resource if they have no permission to actually access it? The rate without download situation is mostly to allow people to set up for cases where the file may have been available elsewhere, to save whatever wasted time downloading may create. I don't really understand what your use case is.

    Regardless, because of the BC break reasons, it might be best for you to make the necessary changes for your needs.
     
  3. bart

    bart Active Member

    I am using the resource manager for classifieds, a library and for displaying events. In none of them downloads have anything to do with it and are not possible. But for rating to be possible I have to set "permission to download" to yes. Which is strange. It is possible to work around, but not how it should be, I think. But it's yours to decide of course.
     

Share This Page