classroom

https://github.com/education/classroom

Ruby

GitHub Classroom automates repository creation and access control, making it easy for teachers to distribute starter code and collect assignments on GitHub.

User#ensure_no_token_scope_loss

Internal: We need to make sure that the user
doesn't reduce the scope of their token. In
the event that their token is needed to
perform other functions.

If the token that is trying to be set is
lower than the one we have toss it, and use the one we have.

If the token has the same scopes but is newer, or has more scopes
let the token be set.

See https://github.com/education/classroom/issues/445

Source | Google | Stack overflow

Edit

git clone [email protected]:education/classroom.git

cd classroom

open app/models/user.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-User-ensure_no_token_scope_loss-for-pr


# Commit to git

git add app/models/user.rbgit commit -m "better docs for User#ensure_no_token_scope_loss"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-User-ensure_no_token_scope_loss-for-pr

hub pull-request


# Celebrate!