If a role does not have any permissions set, it prevents other roles (that come after it in alphabetical order) from having their permissions set correctly.

To test setup an 'aardvark' role and don't assign it any permissions.

Line 197 in secure_permissions_build_permissions() appears to be at fault. It stops it looping if a role has doesn't have any permissions set.

Comments

agentrickard’s picture

Priority:Critical» Normal

Since this can be mitigated (by setting a permission), I don't see it as critical.

I wrote this module to prove a point. It needs a new maintainer.

Patches welcome.

tunny’s picture

Patch attached.

This works for me. However it will need double checking.

If a role isn't defined in the exported settings, it will now lose all its permissions. Is this correct behaviour?

agentrickard’s picture

Status:Active» Needs review

Probably. Given that exporting an empty role would be a destructive act.

mikebell_’s picture

We've been using this in production for a few months now without any issues.

If someone else wants to review then I'll commit it.

cam8001’s picture

Status:Needs review» Reviewed & tested by the community

Patch looks fine to me.

kasperg’s picture

Ran into the same problem for the Drupal 7 1.5 version of the module.

Here is a patch for that.

Xen’s picture

Typo in previous patch, this fixes that.

ultimateboy’s picture

Version:6.x-1.6» 7.x-1.x-dev
Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.