001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.oauth; 003 004/** 005 * List of permissions granted to the current OSM connection. 006 * @since 2747 007 */ 008public class OsmPrivileges { 009 private boolean allowWriteApi; 010 private boolean allowWriteGpx; 011 private boolean allowReadGpx; 012 private boolean allowReadPrefs; 013 private boolean allowWritePrefs; 014 private boolean allowModifyNotes; 015 016 /** 017 * Determines if the client is allowed to modify the map. 018 * @return {@code true} if the client is allowed to modify the map, {@code false} otherwise 019 */ 020 public boolean isAllowWriteApi() { 021 return allowWriteApi; 022 } 023 024 /** 025 * Sets whether the client is allowed to modify the map. 026 * @param allowWriteApi {@code true} if the client is allowed to modify the map, {@code false} otherwise 027 */ 028 public void setAllowWriteApi(boolean allowWriteApi) { 029 this.allowWriteApi = allowWriteApi; 030 } 031 032 /** 033 * Determines if the client is allowed to upload GPS traces. 034 * @return {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise 035 */ 036 public boolean isAllowWriteGpx() { 037 return allowWriteGpx; 038 } 039 040 /** 041 * Sets whether the client is allowed to upload GPS traces. 042 * @param allowWriteGpx {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise 043 */ 044 public void setAllowWriteGpx(boolean allowWriteGpx) { 045 this.allowWriteGpx = allowWriteGpx; 046 } 047 048 /** 049 * Determines if the client is allowed to read private GPS traces. 050 * @return {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise 051 */ 052 public boolean isAllowReadGpx() { 053 return allowReadGpx; 054 } 055 056 /** 057 * Sets whether the client is allowed to read private GPS traces. 058 * @param allowReadGpx {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise 059 */ 060 public void setAllowReadGpx(boolean allowReadGpx) { 061 this.allowReadGpx = allowReadGpx; 062 } 063 064 /** 065 * Determines if the client is allowed to read user preferences. 066 * @return {@code true} if the client is allowed to read user preferences, {@code false} otherwise 067 */ 068 public boolean isAllowReadPrefs() { 069 return allowReadPrefs; 070 } 071 072 /** 073 * Sets whether the client is allowed to read user preferences. 074 * @param allowReadPrefs {@code true} if the client is allowed to read user preferences, {@code false} otherwise 075 */ 076 public void setAllowReadPrefs(boolean allowReadPrefs) { 077 this.allowReadPrefs = allowReadPrefs; 078 } 079 080 /** 081 * Determines if the client is allowed to modify user preferences. 082 * @return {@code true} if the client is allowed to modify user preferences, {@code false} otherwise 083 */ 084 public boolean isAllowWritePrefs() { 085 return allowWritePrefs; 086 } 087 088 /** 089 * Sets whether the client is allowed to modify user preferences. 090 * @param allowWritePrefs {@code true} if the client is allowed to modify user preferences, {@code false} otherwise 091 */ 092 public void setAllowWritePrefs(boolean allowWritePrefs) { 093 this.allowWritePrefs = allowWritePrefs; 094 } 095 096 /** 097 * Determines if the client is allowed to modify notes. 098 * @return {@code true} if the client is allowed to modify notes, {@code false} otherwise 099 */ 100 public boolean isAllowModifyNotes() { 101 return allowModifyNotes; 102 } 103 104 /** 105 * Sets whether the client is allowed to modify notes. 106 * @param allowModifyNotes {@code true} if the client is allowed to modify notes, {@code false} otherwise 107 */ 108 public void setAllowModifyNotes(boolean allowModifyNotes) { 109 this.allowModifyNotes = allowModifyNotes; 110 } 111}