Not sure if this is a og_user_roles module issue or a drigg issue, but so far only the drigg module and de case tracker module had these kinds of problems with the og_user_roles module.

The og_user_roles module has a permission check, that checks if the user has 'create' rights and it uses preg_match('/create/'..... to check for it.

the function drigg_perm returns an array with 'submit drigg stories'. This causes the preg_match function not to match. When I change the two occurences of "submit drigg stories" to "create drigg stories" everything seems to work fine.

Comments

analogious’s picture

The same seems to be the case for "view drigg stories" -> "access drigg stories" in the drigg.module file.

mercmobily’s picture

Hi,

Ugh. Changing the permission will break everybody's site. It's a very trivial change, but it will confuse the hell out of existing users.

Can you tell me if drigg _actually_ breaks some kind of Drupal standard in terms of naming those permissions?

Bye,

Merc.

analogious’s picture

I see your problem.

I have not found any naming standards that would indicate it actually breaks drupal permissions.
I will take my problem to the og_user_roles maintainers.

mercmobily’s picture

Hi,

OK although... I guess I really ought to comply.
Can you think of a way so that we make this change without screwing dry other Drigg users? (And without causing a revolt...)

Or maybe we could write a bit of code during the upgrade, to set the new permission variables... but that sounds like a lot of work in terms of debugging.

It's tricky. Ideas?

Merc.

sikjoy’s picture

Hi Merc:

We can add a hook_update_N function to the drigg.install file that will add the new variables while retaining the previously set values from the old variables. I believe this function is intended for database updates, but I don't see any reason that we couldn't use it for variable name changes.

--sicjoy

mercmobily’s picture

Hi,

Sicjoy: I am notoriously error prone with this sort of things. Are you able to do it (4 minutes) and test it (much more than 4 minutes :-) )?

Thanks!

Merc.

sikjoy’s picture

Assigned: Unassigned » sikjoy

OK - will do.

sikjoy’s picture

Version: 5.x-1.33 » 5.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new7.61 KB

Here's a patch:

I tested it once on my devel server. Due to the nature of these kinds of updates, it's difficult to retest it. Webno or Merc, do you mind testing the patch before I commit to CVS?

It should change the permission names as follows:

view drigg stories -> access drigg stories
submit drigg stories -> create drigg stories
submit-as powers in drigg -> create-as powers in drigg
view individual karma scores -> access individual karma scores
view arrows for voted stories -> access arrows for voted stories
view users by karma -> access users by karma

I realize that some of the changes weren't required for the compatibility fix, but a made them for the sake of consistency.

Additionally, all of the permissions settings should be maintained, i.e. the admin shouldn't need to revisit their Access Control settings after the update.

--sicjoy

mercmobily’s picture

Hi,

I am not able to test it right now, I am travelling.
But, I will not commit this patch unless 2 or 3 people confirm that it works after *careful* testing.

People, users, if you care about Drigg, please help!

Merc.

analogious’s picture

I will test it either today or this weekend.

analogious’s picture

StatusFileSize
new7.46 KB
new7.46 KB

First I updated drigg and ran the patch on my site. All went well. The One thing that didn't work well was remembering the "create drigg" access control setting, but this is because I had already modified that string before the update, so its information was lost during the upgrade and not during the patching I presume.

I checked the functionality of access control in combination with og_user_roles and found all went well.

Note that my running site had strings like 'create' and 'access' in its database before the upgrade.

Thanks.

Bart.

sikjoy’s picture

For people testing this patch:

It is extremely important to run update.php after applying the patch. Otherwise, your Drigg site will not preserve its previous access control settings.

--sicjoy

sikjoy’s picture

Status: Fixed » Needs review

Allrighty!

Tested one more time against the current 5.x-1.x-dev. Looks good!

D6 hear we come.

w00t!

sikjoy’s picture

Status: Needs review » Fixed
mercmobily’s picture

Status: Needs review » Closed (fixed)