(Answer) (Category) Faq-O-Matic Faq-O-Matic : (Category) Administrators' Guide : (Category) Customize :
How to relax subcategory permissions
This feature now appears in FAQ-O-Matic version 2.715. Thanks, David!
There's a nice option in FAQ-O-Matic that, unfortunately, doesn't appear to be implemented, that of "relaxing" subcategory permissions.

I was creating a "rants" section on a FAQ-O-Matic where people could add their own subcategories for their personal ranting. I wanted to be able to give people the ability to add their own rants, but not remove other people's rants.

This became a problem because the subcategories had the same ownership and permissions as the parent category, which meant that unless I gave people permission to modify the general rant area's permissions, they also wouldn't be able to set their personal category's permissions/ownership.

Then, I found the "relax permissions on subcategories" option. After studying the code and realizing that it didn't do anything, I came up with a quick fix that solved the problem for me. With a few lines of additional code, if a parent category is marked as "relax", new child categories become owned by the person who created them. Granted, that person still cannot delete his/her own rant section, but at least he/she can change the contents fully at will.

in addItem.pl, after the lines:

                # regardless of what the parent did, we inherit moderator    
                # from parent rather than setting it explicitly.
add the following:
                # BZZT.  That sucks.  Set it explicitly if relax is set.     
        if ($item->getProperty('RelaxChildPerms') eq 'relax') {
                my ($id,$aq) = FAQ::OMatic::Auth::getID();
                if ($id) { 
                        $newitem->setProperty('Moderator', $id);
                } else {
                        print FAQ::OMatic::header($cgi, '-type'=>'text/plain');
                        displayMessage("You must be logged in to add to a category if RelaxChildPerms is set to relax.\nYou should not ever see this message.  Contact your site administrator.\n");
                        FAQ::OMatic::myExit(0);
                }
        }


[Append to This Answer]
Previous: (Answer) Support/Contracting Available?
Next: (Answer) I want to use an external cgi-server. Is that possible with fom?
This document is: http://www.jonh.net/cgi-bin/faqomatic/fom?file=1632
[Search] [Appearance]
This is a Faq-O-Matic 2.718d.
Hosted by SourceForge Logo and jonh.net.