code: private void assertClientMayUpdate(int hour) {
          OAuthContext oauth = getOAuthContext();
          List<OAuthPermission> perms = oauth.getPermissions();
          boolean checkPassed = false;
          for (OAuthPermission perm : perms) {
              if (perm.getPermission().startsWith(OAuthConstants.UPDATE_CALENDAR_SCOPE)) {
                  int authorizedHour = Integer.valueOf(perm.getPermission()
                      .substring(OAuthConstants.UPDATE_CALENDAR_SCOPE.length()));
                  if (authorizedHour == 24 || authorizedHour == hour) {
                      checkPassed = true;
                  }
              }
          }
          if (!checkPassed) {
              throw new WebApplicationException(403);
          }
      }
docs: This permission check can be done in a custom filter; it can be simpler to do in the actual service
  code if the context data (such as an hour in this case) are not available in the request URI but in the
  message payload
  
  @param hour