Adding Attributes to Groups as well as Users

Permalink
I am using ProBlog on a community site I am building. ProBlog uses a custom attribute to determine the right to blog rather than group membership.

I will have a large number of people who will have blogging rights and I don't really want to have to edit their attributes individually. So, is it possible to add custom attributes to a group?

I'm pretty sure the answer is no as I have searched high and low, but I wanted to be sure.

Gareth

garethhowell
 
RadiantWeb replied on at Permalink Best Answer Reply
RadiantWeb
Hi Gareth,

The reason PB is designed that way, is because for many less technically savvy users, permissions and groups are very confusing. A user attribute for most uses is pretty easy to teach. And most uses do not need more than a couple.

As far as doing what you want to be able to do, simply add the following to your /packages/problog/elements/header_menu/controller.php after line 13:

$groups = $u->getUserGroups();


then replace the "condition" with the following (adding in "|| in_array('My Group Name',$groups)"):

if (($isAuthor || $u->isSuperUser()) && ($pm->canAddSubContent() || in_array('My Group Name',$groups))){
   return true;
}


ChadStrat
garethhowell replied on at Permalink Reply
garethhowell
Brilliant. Thanks Chad.

Gareth
senshidigital replied on at Permalink Reply
senshidigital
I would really like to enable this feature for one of our clients too, however, changing this file appears to have no effect.

Any suggestions as to what is wrong? Here is the code I'm editing in the /packages/problog/elements/header_menu/controller.php.

$groups = $u->getUserGroups();
         if (($isAuthor || $u->isSuperUser()) && ($pm->canAddSubContent() || in_array('New Subscribers',$groups))){
            return true;
         }


Thanks