You can also use the Rules module for this. If you don't have Rules enabled yet, you can pretty sure use it to implement lots of other features in your site. That will help to reduce the risk of your site suffering "modulitis" (= way too much contributed modules slowing down a site).
Have a look at this custom rule (in Rules export format):
{ "rules_disallow_updates_to_content" : {
"LABEL" : "Disallow updates to content",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "init" : [] },
"IF" : [
{ "OR" : [
{ "text_matches" : {
"text" : [ "site:current-page:path" ],
"match" : "node\/add\/",
"operation" : "starts"
}
},
{ "text_matches" : {
"text" : [ "site:current-page:path" ],
"match" : "\/edit",
"operation" : "ends"
}
},
{ "text_matches" : {
"text" : [ "site:current-page:path" ],
"match" : "\/delete",
"operation" : "ends"
}
}
]
},
{ "NOT user_has_role" : {
"account" : [ "site:current-user" ],
"roles" : { "value" : { "3" : "3" } }
}
}
],
"DO" : [
{ "drupal_message" : {
"message" : "\u003Cstrong\u003EMaintenance ongoing!\u003C\/strong\u003E, therefor a path like [site:current-page:path] is currently not allowed.",
"type" : "error"
}
},
{ "redirect" : { "url" : "no_access" } }
]
}
}
If you have the Rules UI enabled, you can import the above rule in your own site.
Some details about what this rule actually does:
All it takes to use this rule is to enable the rule while maintenance is ongoing (and disable the rule when maintenance is finished).
Possible improvements
You have all the power of Rules available to further improve this rule, e.g.:
- Send an eMail to an admin if special conditions are met (eg to eMail data about the actual user who was blocked by this rule).
- Refine the message being shown (e.g. with an hyperlink to a page with more details about scheduled maintenance).