Comments

agentrickard’s picture

Awesome. I love the idea.

greg.harvey’s picture

Status: Active » Needs review
StatusFileSize
new3.79 KB

Alright, this ought to do it! There are two commands (I documented them well with help and argument descriptions).

- drush rebuild-perms
- drush sec-perms

The former is a straightforward call to the permissions rebuilding function in the main module. However, while writing this I realised it fails silently if Secure Permissions is deactivated, so I decided to check for that and fire an error if someone rebuilds perms without having the module active.

I then thought "if that happens to me, I want to be able to activate it from terminal!" so I wrote the latter command. At the moment all it does is activate/deactive the module by setting the secure_permissions_active variable, however I've made the function nice and generic in name and nature, so anyone could extend it in the future to allow further settings manipulation from drush very easily.

This is tested against Drupal 6 but not Drupal 7, though as far as I can tell from the module code it should also work for Drupal 7. Please test and report back - of particular concern is whether the sec-perms on/off commands work in D7, because there is a subtle difference in variable value (from 1 to TRUE and 0 to FALSE). Should still be ok, thanks for PHP not being too fussy about type, but I haven't tried it.

That's all folks! I've tested it and it works for me.

greg.harvey’s picture

Oops - forgot a help entry for drush sec-perms. New patch.

agentrickard’s picture

Awesome. At DrupalCON, so it may take a while to review.

james.wilson’s picture

This would be pretty handy. Any update on the review?

agentrickard’s picture

I haven't been paying this module much attention. Hoped someone else would review.

greg.harvey’s picture

My colleagues have reviewed it (we're using it on production servers). Don't know if that's good enough for R&TBC. Really I shouldn't 'self-review', but I promise it works!

agentrickard’s picture

Looks pretty good. You folks have any interest in maintaining this module, which I wrote as proof of concept but don't use.

greg.harvey’s picture

We definitely have an interest in the continued maintenance of this module, so I guess that's a yes! If you need someone to cruise the issue queues with you then we'd happily do a bit of that... Not sure how much active dev we'd do, but then we did this, so I guess there will be things that come up that we would add as we find them.

agentrickard’s picture

All right. I gave you full access to the project.

I don't think I've touched this project since the switch to git.

Note that the 7.x branch is still 'master', which needs to be changed to 7.x.1.x properly.

greg.harvey’s picture

Assigned: Unassigned » greg.harvey

Oh, I need to do something with this then! Bumping it for my attention.

greg.harvey’s picture

Version: 6.x-1.5 » 7.x-1.5
Assigned: greg.harvey » Unassigned
Status: Needs review » Patch (to be ported)

Committed to Drupal 6 version. Needs porting to Drupal 7.

md2’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new0 bytes

Patch attached for D7.

cameron tod’s picture

Your patch is empty, md2. Any chance of a reroll?

cameron tod’s picture

Your patch is empty, md2. Any chance of a reroll?

md2’s picture

Apologies for the delayed re-roll, and for the dud first patch, must have created it with my eyes closed!

New patch attached.

Caveat4U’s picture

Got rid of files[] = secure_permissions.drush.inc as a drush command shouldn't be referenced there in the .info file.
Fixed the file name - from secure_permision.drush.inc to secure_permissions.drush.inc. (Just pluralizing)
Added a configure tag to the .info file.
Added aliases to the drush command to make life simpler when calling these commands.

ultimateboy’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
StatusFileSize
new3.7 KB

Made a few additional modifications. I changed the drush command names to be more verbose (thats why we have aliases), removed the // $ID stuff as thats legacy from CVS days, moved the file in to the root of the module folder instead of in an includes directory, fixed some whitespace errors, and adjusted a few function comments to match coding standards.

Also, Caveat4U, while I agree with adding the "configure=" to the .info, that really should be another issue. I'll go ahead and commit that piece though - nice thought.

I'll probably commit this shortly, just uploading for posterities sake.

ultimateboy’s picture

And somehow my editor wasn't telling me of two more whitespace issues. Thanks dreditor :P

ultimateboy’s picture

Status: Fixed » Closed (fixed)

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