Support for multiple categories or – again

Hi,

I would like to add my support to existing requests for support of Multiple Categories – via OR logic rather than AND logic as it is at present. ( https://www.itthinx.com/topic/multiple-categories/, https://www.itthinx.com/topic/restricting-multiple-categories/, https://www.itthinx.com/topic/woocommerce-issues-with-multiple-categories-groups/ – and others).

I note that you have agreed this should become a feature – is there any progress/date yet, please?

I also note on other threads that George has suggested that an AND type logic would produce a flaw in the behavior and not reflect a real use case. I would disagree with that analysis. In our applications, as in many others (probably most use cases I would suggest), one would wish to allow say ‘Silver’ and ‘Gold’ members access to the same/common categories. This is not possible currently (with AND logic) and requires OR logic. Currently, I believe normal page/post assignment to groups works with OR – categories need to work in the same way.

I agree, there are some potential issues with conflicting access permissions being granted via the page/post as opposed to those being granted under the page/posts category – but that dichotomy exists in any case, and simply requires the administrator to enforce/ensure consistency manually.

I have taken a look at implementing OR logic myself – but it is not quite so straightforward 😉

Any date possible guys?

Very many thanks

Rob Cain

3 Responses to Support for multiple categories or – again

  1. George August 26, 2021 at 1:09 pm #

    Hi Rob,

    I think I misunderstood the topic from the beginning here and must honestly apologise for that.
    The logic behind groups restrictions including post types and taxonomies is a logical disjunction. When a post or taxonomy is restricted to more than one groups, a user can access that content only if they are at least a member of one of these groups.
    For example Blog-posts category is restricted to Silver and Gold groups and user Rob is a member of Silver group, he can access that category.

    If the result you get is different then there is probably an issue, but just in case this is needed make sure to update Groups and Groups Restrict Categories to their latest versions available, Groups 2.14.1 and Groups Restrict Categories 2.2.0.
    Furthermore and because of the whole misunderstanding on my end I may offer to have a look at your site and setup if you wish to provide me temp admin access to it. For this case you may create an account using my personal email address, george at itthinx dot com.

    For the record with a logical disjunction the result is true when at least one counterpart is true, ie
    1 2 1V2
    T T T
    T F T
    F T T
    F F F

    Kind regards,
    George

  2. Walter Cain August 24, 2021 at 8:07 pm #

    Hi George,

    Thanks for your reply.

    I don’t think your reasoning is quite right however – vis: – you say: “… If for example a post is restricted to Silver group only, then with a logical disjunction everyone will have access to it, the access check will be done for Silver members or any members so everyone will be able to view that content.” – simply No: Only members of either or both groups would have access in that case.

    There is the question of what access permissions should be applied to pages/posts with NO (restricted) categories assigned (or for that matter access to pages/posts with no group restrictions applied). Logically, there should be NO access, by anyone if there hasn’t been a restricted member privilege assigned. That might get slightly clunky to use, therefore better perhaps to impose a switch rule: ‘if no member privilege/privileges assigned to page/post/cat then open to all, else if ANY (one of more) assigned, then user must be a member of AT LEAST one (of the privilege groups assigned). This would work in the way needed.

    I’m afraid your ‘workaround’ example (creating a new silver-gold group) is wholly unworkable – a) very clunky/illogical to administer, b) would require replicating restricted content (pages, posts, cats) for EACH group – Silver, Gold, Silver-Gold – absolutekly impractical I’m afraid, & defeats the whole purpose of the groups plugin(s).

    George, can I urge you to have a harder think about this? Meanwhile, I’ll dig further into the code this end & see if I cant get something working. Any pointers you could give me would be very welcome (eg: you mentioned there probably has to be change to the core plugin too – i’ve already changed what seemed to be the relevant parts of the ‘groups-restricted-categories’ plugin, but it didn’t work as expected, (maybe cache, maybe complementary/negative logic/access-blocking rules to consider too…), – I still need to gain better familiarity with it ) .

    In principle, your groups plugins are really great – potentially they address a great number of use cases/problems and fill a real hole in the WordPress architecture/ecosphere. (No one is offering anything quite so good/comprehensive thus far in this space). We just need to stretch its capabilities a bit.

    All very best
    Rob

  3. George August 24, 2021 at 1:35 pm #

    Hi Rob,

    Thanks for mentioning that feature and the discussion around it.
    Indeed issues with access permissions will definitely occur and this is one of the main reasons why this feature hasn’t been implemented yet. If for example a post is restricted to Silver group only, then with a logical disjunction everyone will have access to it, the access check will be done for Silver members or any members so everyone will be able to view that content.
    However, and even with the current version of Groups you can accomplish this by using one additional group for these cases. If you wish to grant access to a post type or taxonomy for users belonging to either one or another group you can use a third group which will be used to restrict access to these specific post types and taxonomies. The plugin itself has no limitation on the number of groups you can create and the users can be members to more than one groups without limits.
    For example a post should be accessed by Silver and Gold group members so first we create a new group ie Silver-and-Gold group and then we add the privileged users to this new group, Silver-and-Gold.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share