Created
October 31, 2013 07:42
-
-
Save emjayess/7245675 to your computer and use it in GitHub Desktop.
Use drush to lock a Drupal site effectively into a read-only state. Have used this as a means to leave a site's content online and available while preparing and even upgrading.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# clear the lock file | |
rm /path/to/drupal/site/lock | |
# grant (back) roles and permissions that are capable of content 'writes' | |
drush @site perm-revoke --roles="contributor" --permissions="post comments,create answer content,create feed content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# place a lock file | |
touch /path/to/drupal/site/lock | |
# revoke roles and permissions that are capable of content 'writes' | |
drush @site perm-revoke --roles="contributor" --permissions="post comments,create answer content,create feed content" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment