Closed (fixed)
Project:
Secure Permissions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2011 at 10:29 UTC
Updated:
21 Jun 2013 at 19:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
agentrickardAwesome. I love the idea.
Comment #2
greg.harveyAlright, 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_activevariable, 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.
Comment #3
greg.harveyOops - forgot a help entry for drush sec-perms. New patch.
Comment #4
agentrickardAwesome. At DrupalCON, so it may take a while to review.
Comment #5
james.wilson commentedThis would be pretty handy. Any update on the review?
Comment #6
agentrickardI haven't been paying this module much attention. Hoped someone else would review.
Comment #7
greg.harveyMy 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!
Comment #8
agentrickardLooks pretty good. You folks have any interest in maintaining this module, which I wrote as proof of concept but don't use.
Comment #9
greg.harveyWe 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.
Comment #10
agentrickardAll 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.
Comment #11
greg.harveyOh, I need to do something with this then! Bumping it for my attention.
Comment #12
greg.harveyCommitted to Drupal 6 version. Needs porting to Drupal 7.
Comment #13
md2 commentedPatch attached for D7.
Comment #14
cameron tod commentedYour patch is empty, md2. Any chance of a reroll?
Comment #15
cameron tod commentedYour patch is empty, md2. Any chance of a reroll?
Comment #16
md2 commentedApologies for the delayed re-roll, and for the dud first patch, must have created it with my eyes closed!
New patch attached.
Comment #17
Caveat4U commentedGot 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.
Comment #18
ultimateboy commentedMade a few additional modifications. I changed the drush command names to be more verbose (thats why we have aliases), removed the
// $IDstuff 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.
Comment #19
ultimateboy commentedAnd somehow my editor wasn't telling me of two more whitespace issues. Thanks dreditor :P
Comment #20
ultimateboy commentedCommitted.
configure link to .info: http://drupalcode.org/project/secure_permissions.git/commit/20142686d529...
drush commands: http://drupalcode.org/project/secure_permissions.git/commit/ef5eec552d0f...
Thanks all!