Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Checking permission access without using pnSecAuthAction?
  • Posted: 15.10.2004, 22:33
     
    alpo3
    rank:
    Freshman Freshman
    registered:
     May 2002
    Status:
    offline
    last visit:
    28.10.04
    Posts:
    18
    My question is about the pnAPI, so I think this is the right place to post this question.

    I am attempting to write some code to check if a News Article (or phpBB topic) is viewable (READ access) by an anonymous user.

    The code I started with looks like this: (NOTE: this example is dealing with phpBB_14.)

    Code

    if (pnSecAuthAction(0, 'phpBB_14::Forum', "$forum_name::", ACCESS_READ) && pnSecAuthAction(0, 'phpBB_14::Category', "$cat_title::", ACCESS_READ))   {
        // do something
    }
    So in this example the code is checking whether the logged in user has READ access to either the Forum or Category of the queried post (not identified above) ... where $forum_name and $cat_title are variables that have been set after doing an initial SQL query.

    The problem is that pnSecAuthAction only works for the user that is logged in and running the script -- which in the example above is the Admin, and therefore would always have access.

    Is there a way to check if a certain article (or topic, or category, or forum) has anonymous READ access -- while being logged in as ADMIN -- or without using pnSecAuthAction?

    I have been searching through these forums for days and I can't find anything. Thanks.
    --
    alpo3
  • Posted: 16.10.2004, 00:12
     
    alpo3
    rank:
    Freshman Freshman
    registered:
     May 2002
    Status:
    offline
    last visit:
    28.10.04
    Posts:
    18
    Just updating this thread to let everyone know that I have found a post requesting a similar need here. That topic is a month old, and no one has responded yet.

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula