for (String scope : scopes) {
if (scope.equals(OAuthConstants.READ_CALENDAR_SCOPE)) {
list.add(READ_CALENDAR_PERMISSION);
} else if (scope.startsWith(OAuthConstants.UPDATE_CALENDAR_SCOPE)) {
String hourValue = scope.substring(OAuthConstants.UPDATE_CALENDAR_SCOPE.length());
list.add(new OAuthPermission(scope,
OAuthConstants.UPDATE_CALENDAR_DESCRIPTION + hourValue + " o'clock",
Collections.<String>emptyList()));
}
}
if (!scopes.contains(OAuthConstants.READ_CALENDAR_SCOPE)) {