Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

Allowing user to see News articles only from given category  Bottom

  • Hi, I'm trying to understand the way the permissions are working, but I'm not sure how to set user could see only articles from given News category... how does the instance should looks like,please?
  • First the permissions are reading top to bottom

    In your case you could use a permission rule like

    users Categories::Category Category ID:Category Path:Category IPath read access
    users Categories::Category .* no access
    Unregistered Categories::Category .* no access

    before

    Unregistered .* .* read access


    You wrote about "user", users are registered members to your site. If you want the public to access the specific News Category use instead "user" "All groups" and the 3rd permission rule for Unregistered (if I'm not wrong) you don't need then.

    You need to try it a little bit. I'm not a permission rules specialist.



    Edited by mazdev on Mar 12, 2012 - 11:46 PM.

    --
    Carl Georg aka Mazdev

    My Blog - Ruminations of an Expat in Indonesia & Webdevelopment

  • Note that permission patters, can contain only a portion of the required data.
    I mean, for categories you can use either the IDs, or the Path, or the iPath, and it will work.

    If you have a single category to allow, and it has ID = 10027, you can use:

    Code

    Users | Categories::Category | 10027::

    or if you have a complete tree, to use a path would be the best,
    like allowing the access to all the 10027's childs, which iPath is /1/2/10012/10027:

    Code

    Users | Categories::Category | ::/1/2/10012/10027

    I will test those patterns to see another path possibilities too.

    Greetings

    --
    - Mateo T. -
    Mis principios... son mis fines
  • I'm sorry, I see I wrote it badly. I want given usergroup (not a particular user) to not see only articles from given category. I tried what you suggested but still somehow didn't manage it :(
    I want usergroup "ClientsA" to not see only articles from category with ID 1030. They should be able too see and read the rest of my website. If you have any other ideas please share.



    Edited by tjlave on Mar 13, 2012 - 01:15 AM.
  • ClientsA aren't allowed to read category 10030. First you should state who is allowed to read category 10030.

    Lets say you only want ClientXX to be allowed to read category 10030.

    Then you do this:

    Code

    ClientXX | Categories::Category | 10030::   read access
    All groups | Categories::Category | 10030::   no access

    before (above)
    Unregistered | .*  | .*   read access


    BTW You need to create the User groups before



    Edited by mazdev on Mar 13, 2012 - 11:41 PM.

    --
    Carl Georg aka Mazdev

    My Blog - Ruminations of an Expat in Indonesia & Webdevelopment

  • Thank you, it seems it's working - well, at least partially - when I try to reach not allowed category there's an error:

    Code

    WARN (4): E_WARNING: strpos() [function.strpos]: Offset not contained in string in CategoryUtil.php line 1400

    I'm not sure what does it mean :/
    +
    it says:
    "Error! Invalid category passed.". IMO it should be rather something as "You're not allowed to see this", but that's probably just the matter of string.



    Edited by tjlave on Mar 13, 2012 - 07:51 AM.
  • So I fixed error above when I changed "Categories::Category" to "Category" only...

    But I also found since I set such permission such usergroup can't see any blocks on my site and their content, but all the other groups see it without any problems :o( ideas?

    This:

    Code

    ClientsA | Blocks | .*   read access

    didn't help :(



    Edited by tjlave on Mar 13, 2012 - 08:34 AM.
  • You should state Block ID.

    Example

    Code

    ClientsA | Blocks:: | 8::   read access
    All groups | Blocks:: | 8::  no access


    As i said once the permission schema reads top to bottom if you give access to one thing to all and later no access for one specific group it's not going to work.



    Edited by mazdev on Mar 14, 2012 - 12:12 PM.

    --
    Carl Georg aka Mazdev

    My Blog - Ruminations of an Expat in Indonesia & Webdevelopment

This list is based on users active over the last 60 minutes.