sdaugherty / mediawiki-page-attachment

Automatically exported from code.google.com/p/mediawiki-page-attachment
Other
0 stars 0 forks source link

Documentation not clear on how to enable downloads for people not logged in #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

The documentation isn't really clear on the permission settings... I cannot 
figure out how to allow users who are not logged in to actually download 
attachments.  They can see attachments, but not download them.

I tried this:

$wgPageAttachment_permissions['view'           ]['allowed'] = true;
$wgPageAttachment_permissions['download'       ]['allowed'] = true;
$wgPageAttachment_permissions['viewHistory'    ]['allowed'] = true;

$wgPageAttachment_permissions['view'           ]['group']['*'    ] = true;
$wgPageAttachment_permissions['download'       ]['group']['*'    ] = true;
$wgPageAttachment_permissions['viewHistory'    ]['group']['*'    ] = true;

I also added this (although I've no idea what it means):

$wgPageAttachment_permissions['view'           ]['loginRequired'] = false;
$wgPageAttachment_permissions['download'       ]['loginRequired'] = false;
$wgPageAttachment_permissions['viewHistory'    ]['loginRequired'] = false;

But nothing works.

I don't know if this is a bug or a problem with the documentation.

  PageAttachment version  : 3.1.0
  MediaWiki version       : 1.19
  PHP version             : 5.3.3
  Database name           : MySQL
  Database version        : 5.1.66
  Operating System name   : Debian GNU/Linux
  Operating System version: 6.0.7

Original issue reported on code.google.com by t...@cyrius.com on 11 Apr 2013 at 11:19

GoogleCodeExporter commented 8 years ago
Hi tbm:

First, need to specify whether login is required or not for a specific action:

     $wgPageAttachment_permissions['download'       ]['loginRequired'] = false; 

Second, need to specify whether a specific action is allowed or not:

     -- When login is NOT required, the format to allow an action is:

          $wgPageAttachment_permissions['download'       ]['allowed'] = true;

     -- When login IS required, the format to allow an action is:

         -- for any group

          $wgPageAttachment_permissions['download'       ]['group']['*'] = true;   

         -- for a specific group

          $wgPageAttachment_permissions['download'       ]['group']['group name'] = true;

         -- for s specific user 

          $wgPageAttachment_permissions['download'       ]['user' ]['user id'] = true;

Now, you want to allow users to view & download without login in, so you need 
the following configuration:

    $wgPageAttachment_permissions['view'           ]['loginRequired'] = false;
    $wgPageAttachment_permissions['download'       ]['loginRequired'] = false;

    $wgPageAttachment_permissions['view'           ]['allowed'] = true;
    $wgPageAttachment_permissions['download'       ]['allowed'] = true;

The documentation page on user rights management is at the following link:

  http://code.google.com/p/mediawiki-page-attachment/wiki/PageAttachmentUserRights

Let me know how I can improve it to make it more clear.

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 12 Apr 2013 at 6:02

GoogleCodeExporter commented 8 years ago
Aldrin, thanks for taking the time to explain permission handling to me.

I wasn't aware of the wiki page, which is very well done.  It might be worth 
adding that to a README file in the source zip file.

Anyway, I added the configuration settings you suggested and it still did not 
work.  After playing around some more, I found that I need the following 
settings:

$wgPageAttachment_permissions['viewOnProtectedPages'           
]['loginRequired'] = false;
$wgPageAttachment_permissions['downloadOnProtectedPages'       
]['loginRequired'] = false;

$wgPageAttachment_permissions['viewOnProtectedPages'           ]['allowed'] = 
true;
$wgPageAttachment_permissions['DownloadOnProtectedPages'       ]['allowed'] = 
true;

This strikes me as odd because the page is not protected.  I verified by going 
to Special:ProtectedPages and got "No pages are currently protected with these 
parameters."

Original comment by t...@cyrius.com on 12 Apr 2013 at 1:51

GoogleCodeExporter commented 8 years ago
Hi tbm:

Thanks for the suggestion, will add a README file with info.

I would appreciate if you little more details on your wiki setup and I'll try 
to replicate the issue where you need to use protected page setting even though 
you should not need them.

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 15 May 2013 at 6:45

GoogleCodeExporter commented 8 years ago
I believe it's a normal wiki setup. What would you like to know exactly? I can 
share the config file with you or give you an account on the wiki.

Original comment by t...@cyrius.com on 15 May 2013 at 7:49

GoogleCodeExporter commented 8 years ago
Hi tbm:

Okay, finally figured it out:  in MediaWiki there are multiple ways to check 
whether a page is protected or not based on namespace settings, user edit 
permission, etc. The current setup is not foolproof. So, I'll update the code 
to check for all the protection settings before deciding whether the page is 
really protected or not.

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 13 Jun 2013 at 4:22