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

Dizkus

Goto page: [-1] 1 - 2

Bottom
Published permission not working? - Stories::Category Category name::Category ID
  • Posted: 21.03.2008, 15:15
     
    rgasch
    rank:
    Steering Committee Steering Committee
    registered:
     January 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    567
    Well, the category system right now (in 0.8 SVN code, not in RC3) supports the following permission check:

    Code

    $permFilter = array();
            $permFilter[] = array('realm'            => 0,
                                  'component_left'   => 'Categories',
                                  'component_middle' => '',
                                  'component_right'  => 'Category',
                                  'instance_left'    => 'id',
                                  'instance_middle'  => 'path',
                                  'instance_right'   => 'ipath',
                                  'level'            => ACCESS_OVERVIEW);


    So you can use this to filter on categories through generic permissions. This should enable to you filter globally on categories using the permissions rules you described in your post.

    Let me know if this solves your issue.

    Greetings
    R
  • Posted: 21.03.2008, 23:47
     
    uheweb
    rank:
    Professional Professional
    registered:
     September 2004
    Status:
    offline
    last visit:
    10.11.08
    Posts:
    815
    rgasch,

    As I reported earlier in the thread, that merely filters the category, but doesn't restrict any content with the assigned category.

    The News module is a prime example. If you set the news article to a certain category (say MEMBERSONLY with catid of 999), then put a permission of NONE on that category, the news article still shows to everyone.

    ALL GROUPS Categories::Category 999:: NONE - placed above all generic permissions.

    Admins see the news WITH a category:

    News
    [ Front Page | Archive | Submit Article ]
    MEMBERONLY: News Title

    Blah Blah Blah...
    ------------------------------

    NON-logged in or non-MEMBERS group user(hence no permission) user sees:

    News
    [ Front Page | Archive | Submit Article ]
    News Title

    So, the generic permission for categories blocks the use of the category, but not the content itself that is assigned to that category.

    Again, this is a step backwards from using topics/old style categories in that at least there you could block (or enable) an entire section of the site by setting permissions for certain topics. The content AND the topic were blocked.

    I am using SVN and cannot filter any module content by category, just the categories themselves are filtered, but not the content with those assigned categories.

    Following the code in several catagory-enabled modules, I don't see where the content ever has a category filter applied at any level - News, crpCalendar, etc.

    Again, originally, I though this was a features of the new categories - where all modules that use them could have global categories and filter the modules content by using a Categories permission.

    The issue is now, the original Stories Category permission no longer works (as story categories are just a part of the new categorization system) and you can't use the Categories permissions to filter content, either.

    So, to clarify -

    What is the intended functionality with .8? Should it, or should it not filter content by category.
    If so, who else sees the same behavior I do - that the category is filtered, but the content is not.

    icon_smile

    Mateo seemed to see the problem, but as he, and I stated, there seem to be some technical problems implementing at the DBUtil level.

    1. Categories are not attached to the returning data until late in the DBUtil process, so a filter does not work - would need to be done in the marshall / postProcess phase when other iterations occur and a permission check can be done on categories.

    2. With multiple categories possible, how to check against multiple categories at once and determine the "highest" permission. (only applies where multi-categorization is allowed by the module).

    3. If the category permission check is late in the DBUtil postprocess, then record counts are off if some returned records are dropped - affecting total record counts, paging, etc.

    If this is NOT intended functionality, lets just state the limitation and make sure documentation says that categories cannot be used to filter content, merely to classify it.
  • Posted: 22.03.2008, 02:50
     
    nestormateo
    rank:
    Professional Professional
    registered:
     September 2006
    Status:
    offline
    last visit:
    23.11.08
    Posts:
    1457
    I see the problem
    and it can be solved extending the DBUtil's Category filter to exclude the items that belongs to forbidden categories. But i guess it's an overload if you define many permissions levels... i guess that may be for .81, or after the Google Summer of Code where i want to be a student of Robert, passing the categories to a nested way, it can be more reliable than now...

    i'll keep thinking on this icon_smile
    see ya

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Posted: 21.04.2008, 16:48
     
    JørnWildt
    rank:
    Helper Helper
    registered:
     July 2002
    Status:
    offline
    last visit:
    07.09.08
    Posts:
    245
    This has actually been fixed in SVN today icon_smile

    You can now have permissions like:

    Unregistered / Categories::Category / 31|32:: / None

    This will hide all content in News and Pages that belongs to either category 31 or 32.

    If you have multiple categories for each item them you only need access to one of the categories for an item.

    So a News item associated with Cat-31 and Cat-33 *will* show up with the above permissions. A News item associated with Cat-31 and Cat-32 *won't*.
  • Posted: 21.04.2008, 18:29
     
    espaan
    rank:
    Helper Helper
    registered:
     August 2003
    Status:
    offline
    last visit:
    22.11.08
    Posts:
    465
    Great work Jorn.
    The new category stuff has delayed the final release, but there a lot of new possibities for admins to make use of cats and subcats.

    --
    http://www.erikspaan.nl
    http://www.avwijchen.nl

    Involved in: BlankTheme, StoriesExt, Menu templates, SmugView and zikula.nl

Goto page: [-1] 1 - 2

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula