Hi,
I have problem with path access. For example I have role users1, when I check "Access every page except the listed pages" and in textbox below i give "url" or "some pattern" and then when I save settings. On login under the user which has role "users1" pathaccess module doesn't deny access to pages which i pointed. My pattern and url looks like this:
"www.mysite.com/bit/*"
"www.mysite.com/bit/"
"/bit/*"
"bit/"
what is wrong here? Please help.

CommentFileSizeAuthor
#3 path_access-1016868-3930534.patch1.14 KBkorgx

Comments

korgx’s picture

Assigned: korgx » Unassigned

patterns are without quotes

korgx’s picture

Hi all,
I found a potential problem in code of access_path module.
For example if my URL is www.anysite.any/any_page/
if I specify restriction to www.anysite.any/any_page/ it doesn't work
an also does not work for these:
*/any_page/*
*/any_page/
*/any_page

Notice, in readme and online it says that the patterns above are correct, but in reality it works only if I specify this
*any_page*

But then can cause a problem with links like:
www.anysite.any/first_any_page_module
www.anysite.any/any_page_bla_bla/

in order to fix this possibly wrong behavior I added few lines code producing the expected behavior from path_access. See my previous comment.

if ($pages) {
// The current page.
global $base_root;
$path = $base_root . request_uri();
//drupal_get_path_alias(check_plain($_GET['q'])); this line returns only current

I will shortly submit a patch.

Notice also, that blocking some path may create problems to some core/important modules like bitcache. So, I was wondering
if it would be worth having rules to automatically handle these important modules (i.e. exceptions or default setting to disable
path access but not other core functions).

korgx’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new1.14 KB

This is a patch

xurizaemon’s picture

Assigned: Unassigned » xurizaemon
Status: Patch (to be ported) » Fixed

You don't need to use the absolute URL (path access rightly assumes you want to protect a page on your own website, not someone else's).

You don't want to use a preceding or trailing slash (just use the URL as drupal sees it, which you can probably copy from your browser addressbar).

The patterns you want to use are

bit
any_page

You said,

does not work for these:
*/any_page/*
*/any_page/
*/any_page

Notice, in readme and online it says that the patterns above are correct, but in reality it works only if I specify this
*any_page*

If those docs are on Drupal.org, you should be able to update the documentation yourself. You can also provide a patch to the README.txt, although I can't see those patterns in the README I have here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

astro87’s picture

This patch helped me, thanks a lot !