Not quite sure how to label what I'm specifically after.
I'm working on an in-house CMS and am now trying toattach permissions to
pages of the site. So, for instance, I have this:
page 1 - bob
page 2 - sarah
page 3 - john
On an individual basis, it's easy to check the permissions. For instance,
when loading up page 3 for editing, I can check to see if john has
permissions.
However, I'd like these permissions to inherit. In otherwords, both bob and
sarah should also have permission to edit page 3. however, bob and sarah
aren't connected to the page 3 record, so I'm trying to think of the most
efficient way to handle this.
The only solution I've come up with is to do a recursive backwords query:
dim strPermissions as string
function getPermissions(pageIDtoGrab)
SELECT user, parentID WHERE pageID = pageIDtoGrab
strPermissions = strPermissions + user
if not parentID = 0 then
getPermissions(parentID)
end if
end function
BUT, I know I'm supposed to avoid recursive functions if possible. Can I
avoid it in this case?