File Permission not working for all roles

WP-Filebase Pro Forums General Support File Permission not working for all roles

Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1430
    Meghan
    Participant

    This one really has me stumped. I have about 20 roles that I have added with the user role editor plugin. I upload files and set access by checking the boxes of the roles I wish to be able to view them. For most roles this works fine. However there are a few roles where they can not view the files that they should have access to. Any ideas, this is driving me crazy! version 3.1.12

    Thank You!!!

    • This topic was modified 10 years, 5 months ago by Meghan.
    #1432
    Meghan
    Participant

    Upon deeper exploration I have found that this issue only occurs on user roles that have a Role name (ID) of under 3 letters.

    For Example:

    Role of Credentials Sub Committee: ID = CSC -> FILE PERMISSIONS DO NOT WORK

    Role of Developer: ID = developer -> FILE PERMISSIONS WORK

    I tested on all my roles and found this to be true.

    Is there any way I can fix this without renaming all of my roles? I have a lot of other logic that works on this naming convention.

    thanks!!!

    #1435
    Meghan
    Participant

    I have also found that permissions work for the direct link. So essentially the only issue is that it is just not displaying the link when a user has the appropriate permission. They can download the file if they paste in the url to the address bar. I’m combing through the code to try and figure out why this is happening, but so far to no avail.

    #1441
    Meghan
    Participant

    Here is how I fixed the issue. It was caused by a mysql default.

    [mysqld]
    ft_min_word_len=3 change to

    [mysqld]
    ft_min_word_len=1

    However I do not have access to mysql settings on my production server for this project so I used the following to fix the issue.

    edit classes/item.php line 557

    $permission_sql .= ” OR MATCH($permissions_field) AGAINST (‘{$ur}’ IN BOOLEAN MODE)”;

    Changed to:

    $permission_sql .= ” OR $permissions_field LIKE ‘%$ur|%’ OR $permissions_field LIKE ‘%|$ur|%’ OR $permissions_field LIKE ‘%$ur|%'”;

    Hope this helps if you run into this issue.

    #1572
    Fabian
    Participant

    Thanks for posting this. You are right, permissions does not properly work if the role name is shorter than 4 chars (this is the default value for ft_min_word_len).

    I will icnlude this in the next update! Do you have a website I can put into the credits?

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.