openstreetmap-website
https://github.com/openstreetmap/openstreetmap-website
Ruby
The Rails application that powers OpenStreetMap
ApplicationController#authorize_moderator
to be used as a before_filter *after* authorize. this checks that the user is a moderator and, if not, returns a forbidden error. NOTE: this isn't a very good way of doing it - it duplicates logic from require_moderator - but what we really need to do is a fairly drastic refactoring based on :format and respond_to? but not a good idea to do that in this branch.
Edit
git clone [email protected]:openstreetmap/openstreetmap-website.git
cd openstreetmap-website
open app/controllers/application_controller.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-ApplicationController-authorize_moderator-for-pr
# Commit to gitgit add app/controllers/application_controller.rbgit commit -m "better docs for ApplicationController#authorize_moderator"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-ApplicationController-authorize_moderator-for-pr
hub pull-request
# Celebrate!