module OauthHelper def scope_name(scope) scope.gsub(/(\:.+)/, '') end def scope_permissions(scope) scope.match(/\:r$/) ? "r" : "rw" end end