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 private boolean allowWriteDiary; 016 017 /** 018 * Determines if the client is allowed to modify the map. 019 * @return {@code true} if the client is allowed to modify the map, {@code false} otherwise 020 */ 021 public boolean isAllowWriteApi() { 022 return allowWriteApi; 023 } 024 025 /** 026 * Sets whether the client is allowed to modify the map. 027 * @param allowWriteApi {@code true} if the client is allowed to modify the map, {@code false} otherwise 028 */ 029 public void setAllowWriteApi(boolean allowWriteApi) { 030 this.allowWriteApi = allowWriteApi; 031 } 032 033 /** 034 * Determines if the client is allowed to upload GPS traces. 035 * @return {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise 036 */ 037 public boolean isAllowWriteGpx() { 038 return allowWriteGpx; 039 } 040 041 /** 042 * Sets whether the client is allowed to upload GPS traces. 043 * @param allowWriteGpx {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise 044 */ 045 public void setAllowWriteGpx(boolean allowWriteGpx) { 046 this.allowWriteGpx = allowWriteGpx; 047 } 048 049 /** 050 * Determines if the client is allowed to read private GPS traces. 051 * @return {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise 052 */ 053 public boolean isAllowReadGpx() { 054 return allowReadGpx; 055 } 056 057 /** 058 * Sets whether the client is allowed to read private GPS traces. 059 * @param allowReadGpx {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise 060 */ 061 public void setAllowReadGpx(boolean allowReadGpx) { 062 this.allowReadGpx = allowReadGpx; 063 } 064 065 /** 066 * Determines if the client is allowed to read user preferences. 067 * @return {@code true} if the client is allowed to read user preferences, {@code false} otherwise 068 */ 069 public boolean isAllowReadPrefs() { 070 return allowReadPrefs; 071 } 072 073 /** 074 * Sets whether the client is allowed to read user preferences. 075 * @param allowReadPrefs {@code true} if the client is allowed to read user preferences, {@code false} otherwise 076 */ 077 public void setAllowReadPrefs(boolean allowReadPrefs) { 078 this.allowReadPrefs = allowReadPrefs; 079 } 080 081 /** 082 * Determines if the client is allowed to modify user preferences. 083 * @return {@code true} if the client is allowed to modify user preferences, {@code false} otherwise 084 */ 085 public boolean isAllowWritePrefs() { 086 return allowWritePrefs; 087 } 088 089 /** 090 * Sets whether the client is allowed to modify user preferences. 091 * @param allowWritePrefs {@code true} if the client is allowed to modify user preferences, {@code false} otherwise 092 */ 093 public void setAllowWritePrefs(boolean allowWritePrefs) { 094 this.allowWritePrefs = allowWritePrefs; 095 } 096 097 /** 098 * Determines if the client is allowed to modify notes. 099 * @return {@code true} if the client is allowed to modify notes, {@code false} otherwise 100 */ 101 public boolean isAllowModifyNotes() { 102 return allowModifyNotes; 103 } 104 105 /** 106 * Sets whether the client is allowed to modify notes. 107 * @param allowModifyNotes {@code true} if the client is allowed to modify notes, {@code false} otherwise 108 */ 109 public void setAllowModifyNotes(boolean allowModifyNotes) { 110 this.allowModifyNotes = allowModifyNotes; 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 } 130}