Changeset 17972 in josm for trunk/src/org
- Timestamp:
- 2021-07-09T22:33:03+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java
r9201 r17972 13 13 private boolean allowWritePrefs; 14 14 private boolean allowModifyNotes; 15 private boolean allowWriteDiary; 15 16 16 17 /** … … 109 110 this.allowModifyNotes = allowModifyNotes; 110 111 } 112 113 /** 114 * Determines if the client is allowed to write diary. 115 * @return {@code true} if the client is allowed to write diary, {@code false} otherwise 116 * @since 17972 117 */ 118 public boolean isAllowWriteDiary() { 119 return allowWriteDiary; 120 } 121 122 /** 123 * Sets whether the client is allowed to write diary. 124 * @param allowWriteDiary {@code true} if the client is allowed to write diary, {@code false} otherwise 125 * @since 17972 126 */ 127 public void setAllowWriteDiary(boolean allowWriteDiary) { 128 this.allowWriteDiary = allowWriteDiary; 129 } 111 130 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r17196 r17972 360 360 parameters.put("oauth_callback", ""); 361 361 parameters.put("authenticity_token", sessionId.token); 362 if (privileges.isAllowWriteApi()) { 363 parameters.put("allow_write_api", "yes"); 364 } 365 if (privileges.isAllowWriteGpx()) { 366 parameters.put("allow_write_gpx", "yes"); 367 } 368 if (privileges.isAllowReadGpx()) { 369 parameters.put("allow_read_gpx", "yes"); 370 } 371 if (privileges.isAllowWritePrefs()) { 372 parameters.put("allow_write_prefs", "yes"); 373 } 374 if (privileges.isAllowReadPrefs()) { 375 parameters.put("allow_read_prefs", "yes"); 376 } 377 if (privileges.isAllowModifyNotes()) { 378 parameters.put("allow_write_notes", "yes"); 379 } 380 381 parameters.put("commit", "Save changes"); 362 parameters.put("allow_write_api", booleanParam(privileges.isAllowWriteApi())); 363 parameters.put("allow_write_gpx", booleanParam(privileges.isAllowWriteGpx())); 364 parameters.put("allow_read_gpx", booleanParam(privileges.isAllowReadGpx())); 365 parameters.put("allow_write_prefs", booleanParam(privileges.isAllowWritePrefs())); 366 parameters.put("allow_read_prefs", booleanParam(privileges.isAllowReadPrefs())); 367 parameters.put("allow_write_notes", booleanParam(privileges.isAllowModifyNotes())); 368 parameters.put("allow_write_diary", booleanParam(privileges.isAllowWriteDiary())); 382 369 383 370 String request = buildPostRequest(parameters); … … 405 392 } 406 393 } 394 } 395 396 private static String booleanParam(boolean param) { 397 return param ? "1" : "0"; 407 398 } 408 399
Note:
See TracChangeset
for help on using the changeset viewer.