Jump to content

Subcats linked via a parentID... going backwards through the subcats?


scooter41

Recommended Posts

I currently have a system where infinite subcats are linked simply via a parentID field

 

The problem I am having, is I want to apply user access to a category, but need all the sub categories to be affected too. I have userID's in an 'access' field that I can search.

 

main cat 1 -

  sub cat 2 -

    sub cat 3 -

      sub cat 4 -

 

 

So for example if I open subcat4, is there any easy way to detect if the user has permission from main cat 1, or is it a case of looping through the parent ID's going up a level each time and seeing if the userID is present in the access field?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.