Commit 2ee26655da0bbe53f49c0b2a65a8459c722905f4

Authored by Andrii Shvaika
1 parent 5fd15554

Authority check info

Showing 19 changed files with 172 additions and 153 deletions
@@ -46,7 +46,6 @@ import org.thingsboard.server.service.update.UpdateService; @@ -46,7 +46,6 @@ import org.thingsboard.server.service.update.UpdateService;
46 @RequestMapping("/api/admin") 46 @RequestMapping("/api/admin")
47 public class AdminController extends BaseController { 47 public class AdminController extends BaseController {
48 48
49 - public static final String SYS_ADMIN_AUTHORITY_ONLY = " Available for users with System Administrator ('SYS_ADMIN') authority only.";  
50 @Autowired 49 @Autowired
51 private MailService mailService; 50 private MailService mailService;
52 51
@@ -63,7 +62,7 @@ public class AdminController extends BaseController { @@ -63,7 +62,7 @@ public class AdminController extends BaseController {
63 private UpdateService updateService; 62 private UpdateService updateService;
64 63
65 @ApiOperation(value = "Get the Administration Settings object using key (getAdminSettings)", 64 @ApiOperation(value = "Get the Administration Settings object using key (getAdminSettings)",
66 - notes = "Get the Administration Settings object using specified string key. Referencing non-existing key will cause an error." + SYS_ADMIN_AUTHORITY_ONLY) 65 + notes = "Get the Administration Settings object using specified string key. Referencing non-existing key will cause an error." + SYSTEM_AUTHORITY_PARAGRAPH)
67 @PreAuthorize("hasAuthority('SYS_ADMIN')") 66 @PreAuthorize("hasAuthority('SYS_ADMIN')")
68 @RequestMapping(value = "/settings/{key}", method = RequestMethod.GET) 67 @RequestMapping(value = "/settings/{key}", method = RequestMethod.GET)
69 @ResponseBody 68 @ResponseBody
@@ -86,7 +85,7 @@ public class AdminController extends BaseController { @@ -86,7 +85,7 @@ public class AdminController extends BaseController {
86 @ApiOperation(value = "Get the Administration Settings object using key (getAdminSettings)", 85 @ApiOperation(value = "Get the Administration Settings object using key (getAdminSettings)",
87 notes = "Creates or Updates the Administration Settings. Platform generates random Administration Settings Id during settings creation. " + 86 notes = "Creates or Updates the Administration Settings. Platform generates random Administration Settings Id during settings creation. " +
88 "The Administration Settings Id will be present in the response. Specify the Administration Settings Id when you would like to update the Administration Settings. " + 87 "The Administration Settings Id will be present in the response. Specify the Administration Settings Id when you would like to update the Administration Settings. " +
89 - "Referencing non-existing Administration Settings Id will cause an error." + SYS_ADMIN_AUTHORITY_ONLY) 88 + "Referencing non-existing Administration Settings Id will cause an error." + SYSTEM_AUTHORITY_PARAGRAPH)
90 @PreAuthorize("hasAuthority('SYS_ADMIN')") 89 @PreAuthorize("hasAuthority('SYS_ADMIN')")
91 @RequestMapping(value = "/settings", method = RequestMethod.POST) 90 @RequestMapping(value = "/settings", method = RequestMethod.POST)
92 @ResponseBody 91 @ResponseBody
@@ -109,7 +108,7 @@ public class AdminController extends BaseController { @@ -109,7 +108,7 @@ public class AdminController extends BaseController {
109 } 108 }
110 109
111 @ApiOperation(value = "Get the Security Settings object", 110 @ApiOperation(value = "Get the Security Settings object",
112 - notes = "Get the Security Settings object that contains password policy, etc." + SYS_ADMIN_AUTHORITY_ONLY) 111 + notes = "Get the Security Settings object that contains password policy, etc." + SYSTEM_AUTHORITY_PARAGRAPH)
113 @PreAuthorize("hasAuthority('SYS_ADMIN')") 112 @PreAuthorize("hasAuthority('SYS_ADMIN')")
114 @RequestMapping(value = "/securitySettings", method = RequestMethod.GET) 113 @RequestMapping(value = "/securitySettings", method = RequestMethod.GET)
115 @ResponseBody 114 @ResponseBody
@@ -123,7 +122,7 @@ public class AdminController extends BaseController { @@ -123,7 +122,7 @@ public class AdminController extends BaseController {
123 } 122 }
124 123
125 @ApiOperation(value = "Update Security Settings (saveSecuritySettings)", 124 @ApiOperation(value = "Update Security Settings (saveSecuritySettings)",
126 - notes = "Updates the Security Settings object that contains password policy, etc." + SYS_ADMIN_AUTHORITY_ONLY) 125 + notes = "Updates the Security Settings object that contains password policy, etc." + SYSTEM_AUTHORITY_PARAGRAPH)
127 @PreAuthorize("hasAuthority('SYS_ADMIN')") 126 @PreAuthorize("hasAuthority('SYS_ADMIN')")
128 @RequestMapping(value = "/securitySettings", method = RequestMethod.POST) 127 @RequestMapping(value = "/securitySettings", method = RequestMethod.POST)
129 @ResponseBody 128 @ResponseBody
@@ -141,7 +140,7 @@ public class AdminController extends BaseController { @@ -141,7 +140,7 @@ public class AdminController extends BaseController {
141 140
142 @ApiOperation(value = "Send test email (sendTestMail)", 141 @ApiOperation(value = "Send test email (sendTestMail)",
143 notes = "Attempts to send test email to the System Administrator User using Mail Settings provided as a parameter. " + 142 notes = "Attempts to send test email to the System Administrator User using Mail Settings provided as a parameter. " +
144 - "You may change the 'To' email in the user profile of the System Administrator. " + SYS_ADMIN_AUTHORITY_ONLY) 143 + "You may change the 'To' email in the user profile of the System Administrator. " + SYSTEM_AUTHORITY_PARAGRAPH)
145 @PreAuthorize("hasAuthority('SYS_ADMIN')") 144 @PreAuthorize("hasAuthority('SYS_ADMIN')")
146 @RequestMapping(value = "/settings/testMail", method = RequestMethod.POST) 145 @RequestMapping(value = "/settings/testMail", method = RequestMethod.POST)
147 public void sendTestMail( 146 public void sendTestMail(
@@ -165,7 +164,7 @@ public class AdminController extends BaseController { @@ -165,7 +164,7 @@ public class AdminController extends BaseController {
165 164
166 @ApiOperation(value = "Send test sms (sendTestMail)", 165 @ApiOperation(value = "Send test sms (sendTestMail)",
167 notes = "Attempts to send test sms to the System Administrator User using SMS Settings and phone number provided as a parameters of the request. " 166 notes = "Attempts to send test sms to the System Administrator User using SMS Settings and phone number provided as a parameters of the request. "
168 - + SYS_ADMIN_AUTHORITY_ONLY) 167 + + SYSTEM_AUTHORITY_PARAGRAPH)
169 @PreAuthorize("hasAuthority('SYS_ADMIN')") 168 @PreAuthorize("hasAuthority('SYS_ADMIN')")
170 @RequestMapping(value = "/settings/testSms", method = RequestMethod.POST) 169 @RequestMapping(value = "/settings/testSms", method = RequestMethod.POST)
171 public void sendTestSms( 170 public void sendTestSms(
@@ -181,7 +180,7 @@ public class AdminController extends BaseController { @@ -181,7 +180,7 @@ public class AdminController extends BaseController {
181 180
182 @ApiOperation(value = "Check for new Platform Releases (checkUpdates)", 181 @ApiOperation(value = "Check for new Platform Releases (checkUpdates)",
183 notes = "Check notifications about new platform releases. " 182 notes = "Check notifications about new platform releases. "
184 - + SYS_ADMIN_AUTHORITY_ONLY) 183 + + SYSTEM_AUTHORITY_PARAGRAPH)
185 @PreAuthorize("hasAuthority('SYS_ADMIN')") 184 @PreAuthorize("hasAuthority('SYS_ADMIN')")
186 @RequestMapping(value = "/updates", method = RequestMethod.GET) 185 @RequestMapping(value = "/updates", method = RequestMethod.GET)
187 @ResponseBody 186 @ResponseBody
@@ -88,7 +88,7 @@ public class AlarmController extends BaseController { @@ -88,7 +88,7 @@ public class AlarmController extends BaseController {
88 88
89 @ApiOperation(value = "Get Alarm Info (getAlarmInfoById)", 89 @ApiOperation(value = "Get Alarm Info (getAlarmInfoById)",
90 notes = "Fetch the Alarm Info object based on the provided Alarm Id. " + 90 notes = "Fetch the Alarm Info object based on the provided Alarm Id. " +
91 - ALARM_SECURITY_CHECK + ALARM_INFO_DESCRIPTION, produces = MediaType.APPLICATION_JSON_VALUE) 91 + ALARM_SECURITY_CHECK + ALARM_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
92 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 92 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
93 @RequestMapping(value = "/alarm/info/{alarmId}", method = RequestMethod.GET) 93 @RequestMapping(value = "/alarm/info/{alarmId}", method = RequestMethod.GET)
94 @ResponseBody 94 @ResponseBody
@@ -111,7 +111,7 @@ public class AlarmController extends BaseController { @@ -111,7 +111,7 @@ public class AlarmController extends BaseController {
111 "\n\nPlatform also deduplicate the alarms based on the entity id of originator and alarm 'type'. " + 111 "\n\nPlatform also deduplicate the alarms based on the entity id of originator and alarm 'type'. " +
112 "For example, if the user or system component create the alarm with the type 'HighTemperature' for device 'Device A' the new active alarm is created. " + 112 "For example, if the user or system component create the alarm with the type 'HighTemperature' for device 'Device A' the new active alarm is created. " +
113 "If the user tries to create 'HighTemperature' alarm for the same device again, the previous alarm will be updated (the 'end_ts' will be set to current timestamp). " + 113 "If the user tries to create 'HighTemperature' alarm for the same device again, the previous alarm will be updated (the 'end_ts' will be set to current timestamp). " +
114 - "If the user clears the alarm (see 'Clear Alarm(clearAlarm)'), than new alarm with the same type and same device may be created. " 114 + "If the user clears the alarm (see 'Clear Alarm(clearAlarm)'), than new alarm with the same type and same device may be created. " + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
115 , produces = MediaType.APPLICATION_JSON_VALUE) 115 , produces = MediaType.APPLICATION_JSON_VALUE)
116 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 116 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
117 @RequestMapping(value = "/alarm", method = RequestMethod.POST) 117 @RequestMapping(value = "/alarm", method = RequestMethod.POST)
@@ -138,7 +138,7 @@ public class AlarmController extends BaseController { @@ -138,7 +138,7 @@ public class AlarmController extends BaseController {
138 } 138 }
139 139
140 @ApiOperation(value = "Delete Alarm (deleteAlarm)", 140 @ApiOperation(value = "Delete Alarm (deleteAlarm)",
141 - notes = "Deletes the Alarm. Referencing non-existing Alarm Id will cause an error.", produces = MediaType.APPLICATION_JSON_VALUE) 141 + notes = "Deletes the Alarm. Referencing non-existing Alarm Id will cause an error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
142 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 142 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
143 @RequestMapping(value = "/alarm/{alarmId}", method = RequestMethod.DELETE) 143 @RequestMapping(value = "/alarm/{alarmId}", method = RequestMethod.DELETE)
144 @ResponseBody 144 @ResponseBody
@@ -165,7 +165,7 @@ public class AlarmController extends BaseController { @@ -165,7 +165,7 @@ public class AlarmController extends BaseController {
165 @ApiOperation(value = "Acknowledge Alarm (ackAlarm)", 165 @ApiOperation(value = "Acknowledge Alarm (ackAlarm)",
166 notes = "Acknowledge the Alarm. " + 166 notes = "Acknowledge the Alarm. " +
167 "Once acknowledged, the 'ack_ts' field will be set to current timestamp and special rule chain event 'ALARM_ACK' will be generated. " + 167 "Once acknowledged, the 'ack_ts' field will be set to current timestamp and special rule chain event 'ALARM_ACK' will be generated. " +
168 - "Referencing non-existing Alarm Id will cause an error.", produces = MediaType.APPLICATION_JSON_VALUE) 168 + "Referencing non-existing Alarm Id will cause an error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
169 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 169 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
170 @RequestMapping(value = "/alarm/{alarmId}/ack", method = RequestMethod.POST) 170 @RequestMapping(value = "/alarm/{alarmId}/ack", method = RequestMethod.POST)
171 @ResponseStatus(value = HttpStatus.OK) 171 @ResponseStatus(value = HttpStatus.OK)
@@ -189,7 +189,7 @@ public class AlarmController extends BaseController { @@ -189,7 +189,7 @@ public class AlarmController extends BaseController {
189 @ApiOperation(value = "Clear Alarm (clearAlarm)", 189 @ApiOperation(value = "Clear Alarm (clearAlarm)",
190 notes = "Clear the Alarm. " + 190 notes = "Clear the Alarm. " +
191 "Once cleared, the 'clear_ts' field will be set to current timestamp and special rule chain event 'ALARM_CLEAR' will be generated. " + 191 "Once cleared, the 'clear_ts' field will be set to current timestamp and special rule chain event 'ALARM_CLEAR' will be generated. " +
192 - "Referencing non-existing Alarm Id will cause an error.", produces = MediaType.APPLICATION_JSON_VALUE) 192 + "Referencing non-existing Alarm Id will cause an error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
193 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 193 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
194 @RequestMapping(value = "/alarm/{alarmId}/clear", method = RequestMethod.POST) 194 @RequestMapping(value = "/alarm/{alarmId}/clear", method = RequestMethod.POST)
195 @ResponseStatus(value = HttpStatus.OK) 195 @ResponseStatus(value = HttpStatus.OK)
@@ -212,8 +212,8 @@ public class AlarmController extends BaseController { @@ -212,8 +212,8 @@ public class AlarmController extends BaseController {
212 212
213 @ApiOperation(value = "Get Alarms (getAlarms)", 213 @ApiOperation(value = "Get Alarms (getAlarms)",
214 notes = "Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " + 214 notes = "Returns a page of alarms for the selected entity. Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " +
215 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE)  
216 - @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 215 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
  216 + @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
217 @RequestMapping(value = "/alarm/{entityType}/{entityId}", method = RequestMethod.GET) 217 @RequestMapping(value = "/alarm/{entityType}/{entityId}", method = RequestMethod.GET)
218 @ResponseBody 218 @ResponseBody
219 public PageData<AlarmInfo> getAlarms( 219 public PageData<AlarmInfo> getAlarms(
@@ -265,7 +265,7 @@ public class AlarmController extends BaseController { @@ -265,7 +265,7 @@ public class AlarmController extends BaseController {
265 "If the user has the authority of 'Tenant Administrator', the server returns alarms that belongs to the tenant of current user. " + 265 "If the user has the authority of 'Tenant Administrator', the server returns alarms that belongs to the tenant of current user. " +
266 "If the user has the authority of 'Customer User', the server returns alarms that belongs to the customer of current user. " + 266 "If the user has the authority of 'Customer User', the server returns alarms that belongs to the customer of current user. " +
267 "Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " + 267 "Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error. " +
268 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE) 268 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
269 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 269 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
270 @RequestMapping(value = "/alarms", method = RequestMethod.GET) 270 @RequestMapping(value = "/alarms", method = RequestMethod.GET)
271 @ResponseBody 271 @ResponseBody
@@ -312,7 +312,7 @@ public class AlarmController extends BaseController { @@ -312,7 +312,7 @@ public class AlarmController extends BaseController {
312 312
313 @ApiOperation(value = "Get Highest Alarm Severity (getHighestAlarmSeverity)", 313 @ApiOperation(value = "Get Highest Alarm Severity (getHighestAlarmSeverity)",
314 notes = "Search the alarms by originator ('entityType' and entityId') and optional 'status' or 'searchStatus' filters and returns the highest AlarmSeverity(CRITICAL, MAJOR, MINOR, WARNING or INDETERMINATE). " + 314 notes = "Search the alarms by originator ('entityType' and entityId') and optional 'status' or 'searchStatus' filters and returns the highest AlarmSeverity(CRITICAL, MAJOR, MINOR, WARNING or INDETERMINATE). " +
315 - "Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error." 315 + "Specifying both parameters 'searchStatus' and 'status' at the same time will cause an error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
316 , produces = MediaType.APPLICATION_JSON_VALUE) 316 , produces = MediaType.APPLICATION_JSON_VALUE)
317 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 317 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
318 @RequestMapping(value = "/alarm/highestSeverity/{entityType}/{entityId}", method = RequestMethod.GET) 318 @RequestMapping(value = "/alarm/highestSeverity/{entityType}/{entityId}", method = RequestMethod.GET)
@@ -80,7 +80,8 @@ public class AssetController extends BaseController { @@ -80,7 +80,8 @@ public class AssetController extends BaseController {
80 @ApiOperation(value = "Get Asset (getAssetById)", 80 @ApiOperation(value = "Get Asset (getAssetById)",
81 notes = "Fetch the Asset object based on the provided Asset Id. " + 81 notes = "Fetch the Asset object based on the provided Asset Id. " +
82 "If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. " + 82 "If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. " +
83 - "If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer.", produces = MediaType.APPLICATION_JSON_VALUE) 83 + "If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH
  84 + , produces = MediaType.APPLICATION_JSON_VALUE)
84 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 85 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
85 @RequestMapping(value = "/asset/{assetId}", method = RequestMethod.GET) 86 @RequestMapping(value = "/asset/{assetId}", method = RequestMethod.GET)
86 @ResponseBody 87 @ResponseBody
@@ -98,7 +99,8 @@ public class AssetController extends BaseController { @@ -98,7 +99,8 @@ public class AssetController extends BaseController {
98 @ApiOperation(value = "Get Asset Info (getAssetInfoById)", 99 @ApiOperation(value = "Get Asset Info (getAssetInfoById)",
99 notes = "Fetch the Asset Info object based on the provided Asset Id. " + 100 notes = "Fetch the Asset Info object based on the provided Asset Id. " +
100 "If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. " + 101 "If the user has the authority of 'Tenant Administrator', the server checks that the asset is owned by the same tenant. " +
101 - "If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. " + ASSET_INFO_DESCRIPTION, produces = MediaType.APPLICATION_JSON_VALUE) 102 + "If the user has the authority of 'Customer User', the server checks that the asset is assigned to the same customer. "
  103 + + ASSET_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
102 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 104 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
103 @RequestMapping(value = "/asset/info/{assetId}", method = RequestMethod.GET) 105 @RequestMapping(value = "/asset/info/{assetId}", method = RequestMethod.GET)
104 @ResponseBody 106 @ResponseBody
@@ -117,7 +119,7 @@ public class AssetController extends BaseController { @@ -117,7 +119,7 @@ public class AssetController extends BaseController {
117 notes = "Creates or Updates the Asset. When creating asset, platform generates Asset Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) " + 119 notes = "Creates or Updates the Asset. When creating asset, platform generates Asset Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) " +
118 "The newly created Asset id will be present in the response. " + 120 "The newly created Asset id will be present in the response. " +
119 "Specify existing Asset id to update the asset. " + 121 "Specify existing Asset id to update the asset. " +
120 - "Referencing non-existing Asset Id will cause 'Not Found' error.", produces = MediaType.APPLICATION_JSON_VALUE) 122 + "Referencing non-existing Asset Id will cause 'Not Found' error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
121 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 123 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
122 @RequestMapping(value = "/asset", method = RequestMethod.POST) 124 @RequestMapping(value = "/asset", method = RequestMethod.POST)
123 @ResponseBody 125 @ResponseBody
@@ -158,7 +160,7 @@ public class AssetController extends BaseController { @@ -158,7 +160,7 @@ public class AssetController extends BaseController {
158 } 160 }
159 161
160 @ApiOperation(value = "Delete asset (deleteAsset)", 162 @ApiOperation(value = "Delete asset (deleteAsset)",
161 - notes = "Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error.") 163 + notes = "Deletes the asset and all the relations (from and to the asset). Referencing non-existing asset Id will cause an error." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
162 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 164 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
163 @RequestMapping(value = "/asset/{assetId}", method = RequestMethod.DELETE) 165 @RequestMapping(value = "/asset/{assetId}", method = RequestMethod.DELETE)
164 @ResponseStatus(value = HttpStatus.OK) 166 @ResponseStatus(value = HttpStatus.OK)
@@ -187,7 +189,7 @@ public class AssetController extends BaseController { @@ -187,7 +189,7 @@ public class AssetController extends BaseController {
187 } 189 }
188 190
189 @ApiOperation(value = "Assign asset to customer (assignAssetToCustomer)", 191 @ApiOperation(value = "Assign asset to customer (assignAssetToCustomer)",
190 - notes = "Creates assignment of the asset to customer. Customer will be able to query asset afterwards.", produces = MediaType.APPLICATION_JSON_VALUE) 192 + notes = "Creates assignment of the asset to customer. Customer will be able to query asset afterwards." + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
191 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 193 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
192 @RequestMapping(value = "/customer/{customerId}/asset/{assetId}", method = RequestMethod.POST) 194 @RequestMapping(value = "/customer/{customerId}/asset/{assetId}", method = RequestMethod.POST)
193 @ResponseBody 195 @ResponseBody
@@ -223,7 +225,7 @@ public class AssetController extends BaseController { @@ -223,7 +225,7 @@ public class AssetController extends BaseController {
223 } 225 }
224 226
225 @ApiOperation(value = "Unassign asset from customer (unassignAssetFromCustomer)", 227 @ApiOperation(value = "Unassign asset from customer (unassignAssetFromCustomer)",
226 - notes = "Clears assignment of the asset to customer. Customer will not be able to query asset afterwards.", produces = MediaType.APPLICATION_JSON_VALUE) 228 + notes = "Clears assignment of the asset to customer. Customer will not be able to query asset afterwards." + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
227 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 229 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
228 @RequestMapping(value = "/customer/asset/{assetId}", method = RequestMethod.DELETE) 230 @RequestMapping(value = "/customer/asset/{assetId}", method = RequestMethod.DELETE)
229 @ResponseBody 231 @ResponseBody
@@ -261,7 +263,7 @@ public class AssetController extends BaseController { @@ -261,7 +263,7 @@ public class AssetController extends BaseController {
261 @ApiOperation(value = "Make asset publicly available (assignAssetToPublicCustomer)", 263 @ApiOperation(value = "Make asset publicly available (assignAssetToPublicCustomer)",
262 notes = "Asset will be available for non-authorized (not logged-in) users. " + 264 notes = "Asset will be available for non-authorized (not logged-in) users. " +
263 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " + 265 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " +
264 - "However, users that are logged-in and belong to different tenant will not be able to access the asset.", produces = MediaType.APPLICATION_JSON_VALUE) 266 + "However, users that are logged-in and belong to different tenant will not be able to access the asset." + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
265 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 267 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
266 @RequestMapping(value = "/customer/public/asset/{assetId}", method = RequestMethod.POST) 268 @RequestMapping(value = "/customer/public/asset/{assetId}", method = RequestMethod.POST)
267 @ResponseBody 269 @ResponseBody
@@ -290,7 +292,7 @@ public class AssetController extends BaseController { @@ -290,7 +292,7 @@ public class AssetController extends BaseController {
290 292
291 @ApiOperation(value = "Get Tenant Assets (getTenantAssets)", 293 @ApiOperation(value = "Get Tenant Assets (getTenantAssets)",
292 notes = "Returns a page of assets owned by tenant. " + 294 notes = "Returns a page of assets owned by tenant. " +
293 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE) 295 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
294 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 296 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
295 @RequestMapping(value = "/tenant/assets", params = {"pageSize", "page"}, method = RequestMethod.GET) 297 @RequestMapping(value = "/tenant/assets", params = {"pageSize", "page"}, method = RequestMethod.GET)
296 @ResponseBody 298 @ResponseBody
@@ -322,7 +324,7 @@ public class AssetController extends BaseController { @@ -322,7 +324,7 @@ public class AssetController extends BaseController {
322 324
323 @ApiOperation(value = "Get Tenant Asset Infos (getTenantAssetInfos)", 325 @ApiOperation(value = "Get Tenant Asset Infos (getTenantAssetInfos)",
324 notes = "Returns a page of assets info objects owned by tenant. " + 326 notes = "Returns a page of assets info objects owned by tenant. " +
325 - PAGE_DATA_PARAMETERS + ASSET_INFO_DESCRIPTION, produces = MediaType.APPLICATION_JSON_VALUE) 327 + PAGE_DATA_PARAMETERS + ASSET_INFO_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
326 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 328 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
327 @RequestMapping(value = "/tenant/assetInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 329 @RequestMapping(value = "/tenant/assetInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
328 @ResponseBody 330 @ResponseBody
@@ -354,7 +356,7 @@ public class AssetController extends BaseController { @@ -354,7 +356,7 @@ public class AssetController extends BaseController {
354 356
355 @ApiOperation(value = "Get Tenant Asset (getTenantAsset)", 357 @ApiOperation(value = "Get Tenant Asset (getTenantAsset)",
356 notes = "Requested asset must be owned by tenant that the user belongs to. " + 358 notes = "Requested asset must be owned by tenant that the user belongs to. " +
357 - "Asset name is an unique property of asset. So it can be used to identify the asset.", produces = MediaType.APPLICATION_JSON_VALUE) 359 + "Asset name is an unique property of asset. So it can be used to identify the asset." + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
358 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 360 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
359 @RequestMapping(value = "/tenant/assets", params = {"assetName"}, method = RequestMethod.GET) 361 @RequestMapping(value = "/tenant/assets", params = {"assetName"}, method = RequestMethod.GET)
360 @ResponseBody 362 @ResponseBody
@@ -60,7 +60,7 @@ public class AuditLogController extends BaseController { @@ -60,7 +60,7 @@ public class AuditLogController extends BaseController {
60 @ApiOperation(value = "Get audit logs by customer id (getAuditLogsByCustomerId)", 60 @ApiOperation(value = "Get audit logs by customer id (getAuditLogsByCustomerId)",
61 notes = "Returns a page of audit logs related to the targeted customer entities (devices, assets, etc.), " + 61 notes = "Returns a page of audit logs related to the targeted customer entities (devices, assets, etc.), " +
62 "and users actions (login, logout, etc.) that belong to this customer. " + 62 "and users actions (login, logout, etc.) that belong to this customer. " +
63 - PAGE_DATA_PARAMETERS + ADMINISTRATOR_AUTHORITY_ONLY, 63 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH,
64 produces = MediaType.APPLICATION_JSON_VALUE) 64 produces = MediaType.APPLICATION_JSON_VALUE)
65 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 65 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
66 @RequestMapping(value = "/audit/logs/customer/{customerId}", params = {"pageSize", "page"}, method = RequestMethod.GET) 66 @RequestMapping(value = "/audit/logs/customer/{customerId}", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -98,7 +98,7 @@ public class AuditLogController extends BaseController { @@ -98,7 +98,7 @@ public class AuditLogController extends BaseController {
98 @ApiOperation(value = "Get audit logs by user id (getAuditLogsByUserId)", 98 @ApiOperation(value = "Get audit logs by user id (getAuditLogsByUserId)",
99 notes = "Returns a page of audit logs related to the actions of targeted user. " + 99 notes = "Returns a page of audit logs related to the actions of targeted user. " +
100 "For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. " + 100 "For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. " +
101 - PAGE_DATA_PARAMETERS + ADMINISTRATOR_AUTHORITY_ONLY, 101 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH,
102 produces = MediaType.APPLICATION_JSON_VALUE) 102 produces = MediaType.APPLICATION_JSON_VALUE)
103 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 103 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
104 @RequestMapping(value = "/audit/logs/user/{userId}", params = {"pageSize", "page"}, method = RequestMethod.GET) 104 @RequestMapping(value = "/audit/logs/user/{userId}", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -137,7 +137,7 @@ public class AuditLogController extends BaseController { @@ -137,7 +137,7 @@ public class AuditLogController extends BaseController {
137 notes = "Returns a page of audit logs related to the actions on the targeted entity. " + 137 notes = "Returns a page of audit logs related to the actions on the targeted entity. " +
138 "Basically, this API call is used to get the full lifecycle of some specific entity. " + 138 "Basically, this API call is used to get the full lifecycle of some specific entity. " +
139 "For example to see when a device was created, updated, assigned to some customer, or even deleted from the system. " + 139 "For example to see when a device was created, updated, assigned to some customer, or even deleted from the system. " +
140 - PAGE_DATA_PARAMETERS + ADMINISTRATOR_AUTHORITY_ONLY, 140 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH,
141 produces = MediaType.APPLICATION_JSON_VALUE) 141 produces = MediaType.APPLICATION_JSON_VALUE)
142 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 142 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
143 @RequestMapping(value = "/audit/logs/entity/{entityType}/{entityId}", params = {"pageSize", "page"}, method = RequestMethod.GET) 143 @RequestMapping(value = "/audit/logs/entity/{entityType}/{entityId}", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -177,7 +177,7 @@ public class AuditLogController extends BaseController { @@ -177,7 +177,7 @@ public class AuditLogController extends BaseController {
177 177
178 @ApiOperation(value = "Get all audit logs (getAuditLogs)", 178 @ApiOperation(value = "Get all audit logs (getAuditLogs)",
179 notes = "Returns a page of audit logs related to all entities in the scope of the current user's Tenant. " + 179 notes = "Returns a page of audit logs related to all entities in the scope of the current user's Tenant. " +
180 - PAGE_DATA_PARAMETERS + ADMINISTRATOR_AUTHORITY_ONLY, 180 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH,
181 produces = MediaType.APPLICATION_JSON_VALUE) 181 produces = MediaType.APPLICATION_JSON_VALUE)
182 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 182 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
183 @RequestMapping(value = "/audit/logs", params = {"pageSize", "page"}, method = RequestMethod.GET) 183 @RequestMapping(value = "/audit/logs", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -183,7 +183,8 @@ public abstract class BaseController { @@ -183,7 +183,8 @@ public abstract class BaseController {
183 protected static final String SYSTEM_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'SYS_ADMIN' authority."; 183 protected static final String SYSTEM_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'SYS_ADMIN' authority.";
184 protected static final String SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."; 184 protected static final String SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.";
185 protected static final String TENANT_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'TENANT_ADMIN' authority."; 185 protected static final String TENANT_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'TENANT_ADMIN' authority.";
186 - protected static final String TENANT_OR_USER_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority."; 186 + protected static final String TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.";
  187 + protected static final String CUSTOMER_AUTHORITY_PARAGRAPH = "\n\nAvailable for users with 'CUSTOMER_USER' authority.";
187 188
188 protected static final String PAGE_SIZE_DESCRIPTION = "Maximum amount of entities in a one page"; 189 protected static final String PAGE_SIZE_DESCRIPTION = "Maximum amount of entities in a one page";
189 protected static final String PAGE_NUMBER_DESCRIPTION = "Sequence number of page starting from 0"; 190 protected static final String PAGE_NUMBER_DESCRIPTION = "Sequence number of page starting from 0";
@@ -262,8 +263,6 @@ public abstract class BaseController { @@ -262,8 +263,6 @@ public abstract class BaseController {
262 protected static final String RELATION_TYPE_PARAM_DESCRIPTION = "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value."; 263 protected static final String RELATION_TYPE_PARAM_DESCRIPTION = "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.";
263 protected static final String RELATION_TYPE_GROUP_PARAM_DESCRIPTION = "A string value representing relation type group. For example, 'COMMON'"; 264 protected static final String RELATION_TYPE_GROUP_PARAM_DESCRIPTION = "A string value representing relation type group. For example, 'COMMON'";
264 265
265 - protected static final String ADMINISTRATOR_AUTHORITY_ONLY = "Available for users with 'Tenant Administrator' authority only.";  
266 -  
267 public static final String INCORRECT_TENANT_ID = "Incorrect tenantId "; 266 public static final String INCORRECT_TENANT_ID = "Incorrect tenantId ";
268 protected static final String DEFAULT_DASHBOARD = "defaultDashboardId"; 267 protected static final String DEFAULT_DASHBOARD = "defaultDashboardId";
269 protected static final String HOME_DASHBOARD = "homeDashboardId"; 268 protected static final String HOME_DASHBOARD = "homeDashboardId";
@@ -47,7 +47,7 @@ public class ComponentDescriptorController extends BaseController { @@ -47,7 +47,7 @@ public class ComponentDescriptorController extends BaseController {
47 47
48 @ApiOperation(value = "Get Component Descriptor (getComponentDescriptorByClazz)", 48 @ApiOperation(value = "Get Component Descriptor (getComponentDescriptorByClazz)",
49 notes = "Gets the Component Descriptor object using class name from the path parameters. " + 49 notes = "Gets the Component Descriptor object using class name from the path parameters. " +
50 - COMPONENT_DESCRIPTOR_DEFINITION) 50 + COMPONENT_DESCRIPTOR_DEFINITION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
51 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')") 51 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')")
52 @RequestMapping(value = "/component/{componentDescriptorClazz:.+}", method = RequestMethod.GET) 52 @RequestMapping(value = "/component/{componentDescriptorClazz:.+}", method = RequestMethod.GET)
53 @ResponseBody 53 @ResponseBody
@@ -64,7 +64,7 @@ public class ComponentDescriptorController extends BaseController { @@ -64,7 +64,7 @@ public class ComponentDescriptorController extends BaseController {
64 64
65 @ApiOperation(value = "Get Component Descriptors (getComponentDescriptorsByType)", 65 @ApiOperation(value = "Get Component Descriptors (getComponentDescriptorsByType)",
66 notes = "Gets the Component Descriptors using rule node type and optional rule chain type request parameters. " + 66 notes = "Gets the Component Descriptors using rule node type and optional rule chain type request parameters. " +
67 - COMPONENT_DESCRIPTOR_DEFINITION) 67 + COMPONENT_DESCRIPTOR_DEFINITION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
68 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')") 68 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')")
69 @RequestMapping(value = "/components/{componentType}", method = RequestMethod.GET) 69 @RequestMapping(value = "/components/{componentType}", method = RequestMethod.GET)
70 @ResponseBody 70 @ResponseBody
@@ -83,7 +83,7 @@ public class ComponentDescriptorController extends BaseController { @@ -83,7 +83,7 @@ public class ComponentDescriptorController extends BaseController {
83 83
84 @ApiOperation(value = "Get Component Descriptors (getComponentDescriptorsByTypes)", 84 @ApiOperation(value = "Get Component Descriptors (getComponentDescriptorsByTypes)",
85 notes = "Gets the Component Descriptors using coma separated list of rule node types and optional rule chain type request parameters. " + 85 notes = "Gets the Component Descriptors using coma separated list of rule node types and optional rule chain type request parameters. " +
86 - COMPONENT_DESCRIPTOR_DEFINITION) 86 + COMPONENT_DESCRIPTOR_DEFINITION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
87 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')") 87 @PreAuthorize("hasAnyAuthority('SYS_ADMIN','TENANT_ADMIN')")
88 @RequestMapping(value = "/components", params = {"componentTypes"}, method = RequestMethod.GET) 88 @RequestMapping(value = "/components", params = {"componentTypes"}, method = RequestMethod.GET)
89 @ResponseBody 89 @ResponseBody
@@ -57,7 +57,8 @@ public class CustomerController extends BaseController { @@ -57,7 +57,8 @@ public class CustomerController extends BaseController {
57 "If the user has the authority of 'Customer User', the server checks that the user belongs to the customer."; 57 "If the user has the authority of 'Customer User', the server checks that the user belongs to the customer.";
58 58
59 @ApiOperation(value = "Get Customer (getCustomerById)", 59 @ApiOperation(value = "Get Customer (getCustomerById)",
60 - notes = "Get the Customer object based on the provided Customer Id. " + CUSTOMER_SECURITY_CHECK) 60 + notes = "Get the Customer object based on the provided Customer Id. "
  61 + + CUSTOMER_SECURITY_CHECK + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
61 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 62 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
62 @RequestMapping(value = "/customer/{customerId}", method = RequestMethod.GET) 63 @RequestMapping(value = "/customer/{customerId}", method = RequestMethod.GET)
63 @ResponseBody 64 @ResponseBody
@@ -79,7 +80,8 @@ public class CustomerController extends BaseController { @@ -79,7 +80,8 @@ public class CustomerController extends BaseController {
79 80
80 81
81 @ApiOperation(value = "Get short Customer info (getShortCustomerInfoById)", 82 @ApiOperation(value = "Get short Customer info (getShortCustomerInfoById)",
82 - notes = "Get the short customer object that contains only the title and 'isPublic' flag. " + CUSTOMER_SECURITY_CHECK) 83 + notes = "Get the short customer object that contains only the title and 'isPublic' flag. "
  84 + + CUSTOMER_SECURITY_CHECK + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
83 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 85 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
84 @RequestMapping(value = "/customer/{customerId}/shortInfo", method = RequestMethod.GET) 86 @RequestMapping(value = "/customer/{customerId}/shortInfo", method = RequestMethod.GET)
85 @ResponseBody 87 @ResponseBody
@@ -101,7 +103,8 @@ public class CustomerController extends BaseController { @@ -101,7 +103,8 @@ public class CustomerController extends BaseController {
101 } 103 }
102 104
103 @ApiOperation(value = "Get Customer Title (getCustomerTitleById)", 105 @ApiOperation(value = "Get Customer Title (getCustomerTitleById)",
104 - notes = "Get the title of the customer. " + CUSTOMER_SECURITY_CHECK) 106 + notes = "Get the title of the customer. "
  107 + + CUSTOMER_SECURITY_CHECK + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
105 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 108 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
106 @RequestMapping(value = "/customer/{customerId}/title", method = RequestMethod.GET, produces = "application/text") 109 @RequestMapping(value = "/customer/{customerId}/title", method = RequestMethod.GET, produces = "application/text")
107 @ResponseBody 110 @ResponseBody
@@ -122,7 +125,7 @@ public class CustomerController extends BaseController { @@ -122,7 +125,7 @@ public class CustomerController extends BaseController {
122 notes = "Creates or Updates the Customer. When creating customer, platform generates Customer Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) " + 125 notes = "Creates or Updates the Customer. When creating customer, platform generates Customer Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address) " +
123 "The newly created Customer Id will be present in the response. " + 126 "The newly created Customer Id will be present in the response. " +
124 "Specify existing Customer Id to update the Customer. " + 127 "Specify existing Customer Id to update the Customer. " +
125 - "Referencing non-existing Customer Id will cause 'Not Found' error.") 128 + "Referencing non-existing Customer Id will cause 'Not Found' error." + TENANT_AUTHORITY_PARAGRAPH)
126 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 129 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
127 @RequestMapping(value = "/customer", method = RequestMethod.POST) 130 @RequestMapping(value = "/customer", method = RequestMethod.POST)
128 @ResponseBody 131 @ResponseBody
@@ -153,7 +156,9 @@ public class CustomerController extends BaseController { @@ -153,7 +156,9 @@ public class CustomerController extends BaseController {
153 } 156 }
154 157
155 @ApiOperation(value = "Delete Customer (deleteCustomer)", 158 @ApiOperation(value = "Delete Customer (deleteCustomer)",
156 - notes = "Deletes the Customer and all customer Users. All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. Referencing non-existing Customer Id will cause an error.") 159 + notes = "Deletes the Customer and all customer Users. " +
  160 + "All assigned Dashboards, Assets, Devices, etc. will be unassigned but not deleted. " +
  161 + "Referencing non-existing Customer Id will cause an error." + TENANT_AUTHORITY_PARAGRAPH)
157 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 162 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
158 @RequestMapping(value = "/customer/{customerId}", method = RequestMethod.DELETE) 163 @RequestMapping(value = "/customer/{customerId}", method = RequestMethod.DELETE)
159 @ResponseStatus(value = HttpStatus.OK) 164 @ResponseStatus(value = HttpStatus.OK)
@@ -187,7 +192,7 @@ public class CustomerController extends BaseController { @@ -187,7 +192,7 @@ public class CustomerController extends BaseController {
187 192
188 @ApiOperation(value = "Get Tenant Customers (getCustomers)", 193 @ApiOperation(value = "Get Tenant Customers (getCustomers)",
189 notes = "Returns a page of customers owned by tenant. " + 194 notes = "Returns a page of customers owned by tenant. " +
190 - PAGE_DATA_PARAMETERS) 195 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH)
191 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 196 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
192 @RequestMapping(value = "/customers", params = {"pageSize", "page"}, method = RequestMethod.GET) 197 @RequestMapping(value = "/customers", params = {"pageSize", "page"}, method = RequestMethod.GET)
193 @ResponseBody 198 @ResponseBody
@@ -212,7 +217,7 @@ public class CustomerController extends BaseController { @@ -212,7 +217,7 @@ public class CustomerController extends BaseController {
212 } 217 }
213 218
214 @ApiOperation(value = "Get Tenant Customer by Customer title (getTenantCustomer)", 219 @ApiOperation(value = "Get Tenant Customer by Customer title (getTenantCustomer)",
215 - notes = "Get the Customer using Customer Title. " + ADMINISTRATOR_AUTHORITY_ONLY) 220 + notes = "Get the Customer using Customer Title. " + TENANT_AUTHORITY_PARAGRAPH)
216 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 221 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
217 @RequestMapping(value = "/tenant/customers", params = {"customerTitle"}, method = RequestMethod.GET) 222 @RequestMapping(value = "/tenant/customers", params = {"customerTitle"}, method = RequestMethod.GET)
218 @ResponseBody 223 @ResponseBody
@@ -120,7 +120,7 @@ public class DashboardController extends BaseController { @@ -120,7 +120,7 @@ public class DashboardController extends BaseController {
120 } 120 }
121 121
122 @ApiOperation(value = "Get Dashboard (getDashboardById)", 122 @ApiOperation(value = "Get Dashboard (getDashboardById)",
123 - notes = "Get the dashboard based on 'dashboardId' parameter. " + DASHBOARD_DEFINITION, 123 + notes = "Get the dashboard based on 'dashboardId' parameter. " + DASHBOARD_DEFINITION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
124 produces = MediaType.APPLICATION_JSON_VALUE 124 produces = MediaType.APPLICATION_JSON_VALUE
125 ) 125 )
126 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 126 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
@@ -143,7 +143,7 @@ public class DashboardController extends BaseController { @@ -143,7 +143,7 @@ public class DashboardController extends BaseController {
143 "The newly created Dashboard id will be present in the response. " + 143 "The newly created Dashboard id will be present in the response. " +
144 "Specify existing Dashboard id to update the dashboard. " + 144 "Specify existing Dashboard id to update the dashboard. " +
145 "Referencing non-existing dashboard Id will cause 'Not Found' error. " + 145 "Referencing non-existing dashboard Id will cause 'Not Found' error. " +
146 - "Only users with 'TENANT_ADMIN') authority may create the dashboards.", 146 + TENANT_AUTHORITY_PARAGRAPH,
147 produces = MediaType.APPLICATION_JSON_VALUE, 147 produces = MediaType.APPLICATION_JSON_VALUE,
148 consumes = MediaType.APPLICATION_JSON_VALUE) 148 consumes = MediaType.APPLICATION_JSON_VALUE)
149 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 149 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
@@ -177,7 +177,7 @@ public class DashboardController extends BaseController { @@ -177,7 +177,7 @@ public class DashboardController extends BaseController {
177 } 177 }
178 178
179 @ApiOperation(value = "Delete the Dashboard (deleteDashboard)", 179 @ApiOperation(value = "Delete the Dashboard (deleteDashboard)",
180 - notes = "Delete the Dashboard. Only users with 'TENANT_ADMIN') authority may delete the dashboards.") 180 + notes = "Delete the Dashboard." + TENANT_AUTHORITY_PARAGRAPH)
181 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 181 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
182 @RequestMapping(value = "/dashboard/{dashboardId}", method = RequestMethod.DELETE) 182 @RequestMapping(value = "/dashboard/{dashboardId}", method = RequestMethod.DELETE)
183 @ResponseStatus(value = HttpStatus.OK) 183 @ResponseStatus(value = HttpStatus.OK)
@@ -211,7 +211,7 @@ public class DashboardController extends BaseController { @@ -211,7 +211,7 @@ public class DashboardController extends BaseController {
211 211
212 @ApiOperation(value = "Assign the Dashboard (assignDashboardToCustomer)", 212 @ApiOperation(value = "Assign the Dashboard (assignDashboardToCustomer)",
213 notes = "Assign the Dashboard to specified Customer or do nothing if the Dashboard is already assigned to that Customer. " + 213 notes = "Assign the Dashboard to specified Customer or do nothing if the Dashboard is already assigned to that Customer. " +
214 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 214 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
215 produces = MediaType.APPLICATION_JSON_VALUE) 215 produces = MediaType.APPLICATION_JSON_VALUE)
216 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 216 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
217 @RequestMapping(value = "/customer/{customerId}/dashboard/{dashboardId}", method = RequestMethod.POST) 217 @RequestMapping(value = "/customer/{customerId}/dashboard/{dashboardId}", method = RequestMethod.POST)
@@ -251,7 +251,7 @@ public class DashboardController extends BaseController { @@ -251,7 +251,7 @@ public class DashboardController extends BaseController {
251 251
252 @ApiOperation(value = "Unassign the Dashboard (unassignDashboardFromCustomer)", 252 @ApiOperation(value = "Unassign the Dashboard (unassignDashboardFromCustomer)",
253 notes = "Unassign the Dashboard from specified Customer or do nothing if the Dashboard is already assigned to that Customer. " + 253 notes = "Unassign the Dashboard from specified Customer or do nothing if the Dashboard is already assigned to that Customer. " +
254 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may unassign the dashboards from customers.", 254 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
255 produces = MediaType.APPLICATION_JSON_VALUE) 255 produces = MediaType.APPLICATION_JSON_VALUE)
256 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 256 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
257 @RequestMapping(value = "/customer/{customerId}/dashboard/{dashboardId}", method = RequestMethod.DELETE) 257 @RequestMapping(value = "/customer/{customerId}/dashboard/{dashboardId}", method = RequestMethod.DELETE)
@@ -290,7 +290,7 @@ public class DashboardController extends BaseController { @@ -290,7 +290,7 @@ public class DashboardController extends BaseController {
290 290
291 @ApiOperation(value = "Update the Dashboard Customers (updateDashboardCustomers)", 291 @ApiOperation(value = "Update the Dashboard Customers (updateDashboardCustomers)",
292 notes = "Updates the list of Customers that this Dashboard is assigned to. Removes previous assignments to customers that are not in the provided list. " + 292 notes = "Updates the list of Customers that this Dashboard is assigned to. Removes previous assignments to customers that are not in the provided list. " +
293 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 293 + "Returns the Dashboard object. " + TENANT_AUTHORITY_PARAGRAPH,
294 produces = MediaType.APPLICATION_JSON_VALUE, 294 produces = MediaType.APPLICATION_JSON_VALUE,
295 consumes = MediaType.APPLICATION_JSON_VALUE) 295 consumes = MediaType.APPLICATION_JSON_VALUE)
296 296
@@ -365,7 +365,7 @@ public class DashboardController extends BaseController { @@ -365,7 +365,7 @@ public class DashboardController extends BaseController {
365 365
366 @ApiOperation(value = "Adds the Dashboard Customers (addDashboardCustomers)", 366 @ApiOperation(value = "Adds the Dashboard Customers (addDashboardCustomers)",
367 notes = "Adds the list of Customers to the existing list of assignments for the Dashboard. Keeps previous assignments to customers that are not in the provided list. " + 367 notes = "Adds the list of Customers to the existing list of assignments for the Dashboard. Keeps previous assignments to customers that are not in the provided list. " +
368 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 368 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
369 produces = MediaType.APPLICATION_JSON_VALUE, 369 produces = MediaType.APPLICATION_JSON_VALUE,
370 consumes = MediaType.APPLICATION_JSON_VALUE) 370 consumes = MediaType.APPLICATION_JSON_VALUE)
371 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 371 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
@@ -417,7 +417,7 @@ public class DashboardController extends BaseController { @@ -417,7 +417,7 @@ public class DashboardController extends BaseController {
417 417
418 @ApiOperation(value = "Remove the Dashboard Customers (removeDashboardCustomers)", 418 @ApiOperation(value = "Remove the Dashboard Customers (removeDashboardCustomers)",
419 notes = "Removes the list of Customers from the existing list of assignments for the Dashboard. Keeps other assignments to customers that are not in the provided list. " + 419 notes = "Removes the list of Customers from the existing list of assignments for the Dashboard. Keeps other assignments to customers that are not in the provided list. " +
420 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 420 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
421 produces = MediaType.APPLICATION_JSON_VALUE, 421 produces = MediaType.APPLICATION_JSON_VALUE,
422 consumes = MediaType.APPLICATION_JSON_VALUE) 422 consumes = MediaType.APPLICATION_JSON_VALUE)
423 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 423 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
@@ -473,7 +473,7 @@ public class DashboardController extends BaseController { @@ -473,7 +473,7 @@ public class DashboardController extends BaseController {
473 "Be aware that making the dashboard public does not mean that it automatically makes all devices and assets you use in the dashboard to be public." + 473 "Be aware that making the dashboard public does not mean that it automatically makes all devices and assets you use in the dashboard to be public." +
474 "Use [assign Asset to Public Customer](#!/asset-controller/assignAssetToPublicCustomerUsingPOST) and " + 474 "Use [assign Asset to Public Customer](#!/asset-controller/assignAssetToPublicCustomerUsingPOST) and " +
475 "[assign Device to Public Customer](#!/device-controller/assignDeviceToPublicCustomerUsingPOST) for this purpose. " + 475 "[assign Device to Public Customer](#!/device-controller/assignDeviceToPublicCustomerUsingPOST) for this purpose. " +
476 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 476 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
477 produces = MediaType.APPLICATION_JSON_VALUE) 477 produces = MediaType.APPLICATION_JSON_VALUE)
478 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 478 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
479 @RequestMapping(value = "/customer/public/dashboard/{dashboardId}", method = RequestMethod.POST) 479 @RequestMapping(value = "/customer/public/dashboard/{dashboardId}", method = RequestMethod.POST)
@@ -505,7 +505,7 @@ public class DashboardController extends BaseController { @@ -505,7 +505,7 @@ public class DashboardController extends BaseController {
505 505
506 @ApiOperation(value = "Unassign the Dashboard from Public Customer (unassignDashboardFromPublicCustomer)", 506 @ApiOperation(value = "Unassign the Dashboard from Public Customer (unassignDashboardFromPublicCustomer)",
507 notes = "Unassigns the dashboard from a special, auto-generated 'Public' Customer. Once unassigned, unauthenticated users may no longer browse the dashboard. " + 507 notes = "Unassigns the dashboard from a special, auto-generated 'Public' Customer. Once unassigned, unauthenticated users may no longer browse the dashboard. " +
508 - "Returns the Dashboard object. Only users with 'TENANT_ADMIN') authority may assign the dashboards to customers.", 508 + "Returns the Dashboard object." + TENANT_AUTHORITY_PARAGRAPH,
509 produces = MediaType.APPLICATION_JSON_VALUE) 509 produces = MediaType.APPLICATION_JSON_VALUE)
510 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 510 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
511 @RequestMapping(value = "/customer/public/dashboard/{dashboardId}", method = RequestMethod.DELETE) 511 @RequestMapping(value = "/customer/public/dashboard/{dashboardId}", method = RequestMethod.DELETE)
@@ -538,7 +538,7 @@ public class DashboardController extends BaseController { @@ -538,7 +538,7 @@ public class DashboardController extends BaseController {
538 538
539 @ApiOperation(value = "Get Tenant Dashboards by System Administrator (getTenantDashboards)", 539 @ApiOperation(value = "Get Tenant Dashboards by System Administrator (getTenantDashboards)",
540 notes = "Returns a page of dashboard info objects owned by tenant. " + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS + 540 notes = "Returns a page of dashboard info objects owned by tenant. " + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS +
541 - "Only users with 'SYS_ADMIN' authority may use this method.", 541 + SYSTEM_AUTHORITY_PARAGRAPH,
542 produces = MediaType.APPLICATION_JSON_VALUE) 542 produces = MediaType.APPLICATION_JSON_VALUE)
543 @PreAuthorize("hasAuthority('SYS_ADMIN')") 543 @PreAuthorize("hasAuthority('SYS_ADMIN')")
544 @RequestMapping(value = "/tenant/{tenantId}/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET) 544 @RequestMapping(value = "/tenant/{tenantId}/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -567,8 +567,8 @@ public class DashboardController extends BaseController { @@ -567,8 +567,8 @@ public class DashboardController extends BaseController {
567 } 567 }
568 568
569 @ApiOperation(value = "Get Tenant Dashboards (getTenantDashboards)", 569 @ApiOperation(value = "Get Tenant Dashboards (getTenantDashboards)",
570 - notes = "Returns a page of dashboard info objects owned by the tenant of a current user. " + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS +  
571 - "Only users with 'TENANT_ADMIN' authority may use this method.", 570 + notes = "Returns a page of dashboard info objects owned by the tenant of a current user. "
  571 + + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH,
572 produces = MediaType.APPLICATION_JSON_VALUE) 572 produces = MediaType.APPLICATION_JSON_VALUE)
573 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 573 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
574 @RequestMapping(value = "/tenant/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET) 574 @RequestMapping(value = "/tenant/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -600,8 +600,8 @@ public class DashboardController extends BaseController { @@ -600,8 +600,8 @@ public class DashboardController extends BaseController {
600 } 600 }
601 601
602 @ApiOperation(value = "Get Customer Dashboards (getCustomerDashboards)", 602 @ApiOperation(value = "Get Customer Dashboards (getCustomerDashboards)",
603 - notes = "Returns a page of dashboard info objects owned by the specified customer. " + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS +  
604 - "Only users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority may use this method.", 603 + notes = "Returns a page of dashboard info objects owned by the specified customer. "
  604 + + DASHBOARD_INFO_DEFINITION + " " + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
605 produces = MediaType.APPLICATION_JSON_VALUE) 605 produces = MediaType.APPLICATION_JSON_VALUE)
606 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 606 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
607 @RequestMapping(value = "/customer/{customerId}/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET) 607 @RequestMapping(value = "/customer/{customerId}/dashboards", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -641,8 +641,7 @@ public class DashboardController extends BaseController { @@ -641,8 +641,7 @@ public class DashboardController extends BaseController {
641 notes = "Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. " + 641 notes = "Returns the home dashboard object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. " +
642 "If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. " + 642 "If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. " +
643 "If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. " 643 "If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. "
644 - + DASHBOARD_DEFINITION + " " +  
645 - "Only users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority should use this method.", 644 + + DASHBOARD_DEFINITION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
646 produces = MediaType.APPLICATION_JSON_VALUE) 645 produces = MediaType.APPLICATION_JSON_VALUE)
647 @PreAuthorize("isAuthenticated()") 646 @PreAuthorize("isAuthenticated()")
648 @RequestMapping(value = "/dashboard/home", method = RequestMethod.GET) 647 @RequestMapping(value = "/dashboard/home", method = RequestMethod.GET)
@@ -679,7 +678,7 @@ public class DashboardController extends BaseController { @@ -679,7 +678,7 @@ public class DashboardController extends BaseController {
679 notes = "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. " + 678 notes = "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the User. " +
680 "If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. " + 679 "If 'homeDashboardId' parameter is not set on the User level and the User has authority 'CUSTOMER_USER', check the same parameter for the corresponding Customer. " +
681 "If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. " + 680 "If 'homeDashboardId' parameter is not set on the User and Customer levels then checks the same parameter for the Tenant that owns the user. " +
682 - "Only users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority should use this method.", 681 + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
683 produces = MediaType.APPLICATION_JSON_VALUE) 682 produces = MediaType.APPLICATION_JSON_VALUE)
684 @PreAuthorize("isAuthenticated()") 683 @PreAuthorize("isAuthenticated()")
685 @RequestMapping(value = "/dashboard/home/info", method = RequestMethod.GET) 684 @RequestMapping(value = "/dashboard/home/info", method = RequestMethod.GET)
@@ -714,7 +713,7 @@ public class DashboardController extends BaseController { @@ -714,7 +713,7 @@ public class DashboardController extends BaseController {
714 713
715 @ApiOperation(value = "Get Tenant Home Dashboard Info (getTenantHomeDashboardInfo)", 714 @ApiOperation(value = "Get Tenant Home Dashboard Info (getTenantHomeDashboardInfo)",
716 notes = "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the corresponding tenant. " + 715 notes = "Returns the home dashboard info object that is configured as 'homeDashboardId' parameter in the 'additionalInfo' of the corresponding tenant. " +
717 - "Only users with 'TENANT_ADMIN' authority may use this method.", 716 + TENANT_AUTHORITY_PARAGRAPH,
718 produces = MediaType.APPLICATION_JSON_VALUE) 717 produces = MediaType.APPLICATION_JSON_VALUE)
719 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 718 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
720 @RequestMapping(value = "/tenant/dashboard/home/info", method = RequestMethod.GET) 719 @RequestMapping(value = "/tenant/dashboard/home/info", method = RequestMethod.GET)
@@ -740,7 +739,7 @@ public class DashboardController extends BaseController { @@ -740,7 +739,7 @@ public class DashboardController extends BaseController {
740 739
741 @ApiOperation(value = "Update Tenant Home Dashboard Info (getTenantHomeDashboardInfo)", 740 @ApiOperation(value = "Update Tenant Home Dashboard Info (getTenantHomeDashboardInfo)",
742 notes = "Update the home dashboard assignment for the current tenant. " + 741 notes = "Update the home dashboard assignment for the current tenant. " +
743 - "Only users with 'TENANT_ADMIN' authority may use this method.", 742 + TENANT_AUTHORITY_PARAGRAPH,
744 produces = MediaType.APPLICATION_JSON_VALUE) 743 produces = MediaType.APPLICATION_JSON_VALUE)
745 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 744 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
746 @RequestMapping(value = "/tenant/dashboard/home/info", method = RequestMethod.POST) 745 @RequestMapping(value = "/tenant/dashboard/home/info", method = RequestMethod.POST)
@@ -810,7 +809,8 @@ public class DashboardController extends BaseController { @@ -810,7 +809,8 @@ public class DashboardController extends BaseController {
810 EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION + 809 EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION +
811 "Second, remote edge service will receive a copy of assignment dashboard " + 810 "Second, remote edge service will receive a copy of assignment dashboard " +
812 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 811 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
813 - "Third, once dashboard will be delivered to edge service, it's going to be available for usage on remote edge instance.", 812 + "Third, once dashboard will be delivered to edge service, it's going to be available for usage on remote edge instance." +
  813 + TENANT_AUTHORITY_PARAGRAPH,
814 produces = MediaType.APPLICATION_JSON_VALUE) 814 produces = MediaType.APPLICATION_JSON_VALUE)
815 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 815 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
816 @RequestMapping(value = "/edge/{edgeId}/dashboard/{dashboardId}", method = RequestMethod.POST) 816 @RequestMapping(value = "/edge/{edgeId}/dashboard/{dashboardId}", method = RequestMethod.POST)
@@ -850,7 +850,8 @@ public class DashboardController extends BaseController { @@ -850,7 +850,8 @@ public class DashboardController extends BaseController {
850 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION + 850 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION +
851 "Second, remote edge service will receive an 'unassign' command to remove dashboard " + 851 "Second, remote edge service will receive an 'unassign' command to remove dashboard " +
852 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 852 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
853 - "Third, once 'unassign' command will be delivered to edge service, it's going to remove dashboard locally.", 853 + "Third, once 'unassign' command will be delivered to edge service, it's going to remove dashboard locally." +
  854 + TENANT_AUTHORITY_PARAGRAPH,
854 produces = MediaType.APPLICATION_JSON_VALUE) 855 produces = MediaType.APPLICATION_JSON_VALUE)
855 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 856 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
856 @RequestMapping(value = "/edge/{edgeId}/dashboard/{dashboardId}", method = RequestMethod.DELETE) 857 @RequestMapping(value = "/edge/{edgeId}/dashboard/{dashboardId}", method = RequestMethod.DELETE)
@@ -104,7 +104,8 @@ public class DeviceController extends BaseController { @@ -104,7 +104,8 @@ public class DeviceController extends BaseController {
104 @ApiOperation(value = "Get Device (getDeviceById)", 104 @ApiOperation(value = "Get Device (getDeviceById)",
105 notes = "Fetch the Device object based on the provided Device Id. " + 105 notes = "Fetch the Device object based on the provided Device Id. " +
106 "If the user has the authority of 'TENANT_ADMIN', the server checks that the device is owned by the same tenant. " + 106 "If the user has the authority of 'TENANT_ADMIN', the server checks that the device is owned by the same tenant. " +
107 - "If the user has the authority of 'CUSTOMER_USER', the server checks that the device is assigned to the same customer.") 107 + "If the user has the authority of 'CUSTOMER_USER', the server checks that the device is assigned to the same customer." +
  108 + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
108 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 109 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
109 @RequestMapping(value = "/device/{deviceId}", method = RequestMethod.GET) 110 @RequestMapping(value = "/device/{deviceId}", method = RequestMethod.GET)
110 @ResponseBody 111 @ResponseBody
@@ -122,7 +123,8 @@ public class DeviceController extends BaseController { @@ -122,7 +123,8 @@ public class DeviceController extends BaseController {
122 @ApiOperation(value = "Get Device Info (getDeviceInfoById)", 123 @ApiOperation(value = "Get Device Info (getDeviceInfoById)",
123 notes = "Fetch the Device Info object based on the provided Device Id. " + 124 notes = "Fetch the Device Info object based on the provided Device Id. " +
124 "If the user has the authority of 'Tenant Administrator', the server checks that the device is owned by the same tenant. " + 125 "If the user has the authority of 'Tenant Administrator', the server checks that the device is owned by the same tenant. " +
125 - "If the user has the authority of 'Customer User', the server checks that the device is assigned to the same customer. " + DEVICE_INFO_DESCRIPTION) 126 + "If the user has the authority of 'Customer User', the server checks that the device is assigned to the same customer. " +
  127 + DEVICE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
126 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 128 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
127 @RequestMapping(value = "/device/info/{deviceId}", method = RequestMethod.GET) 129 @RequestMapping(value = "/device/info/{deviceId}", method = RequestMethod.GET)
128 @ResponseBody 130 @ResponseBody
@@ -139,11 +141,12 @@ public class DeviceController extends BaseController { @@ -139,11 +141,12 @@ public class DeviceController extends BaseController {
139 141
140 @ApiOperation(value = "Create Or Update Device (saveDevice)", 142 @ApiOperation(value = "Create Or Update Device (saveDevice)",
141 notes = "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " + 143 notes = "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address). " +
142 - "Device credentials are also generated if not provided in the 'accessToken' request parameter. " +  
143 - "The newly created device id will be present in the response. " +  
144 - "Specify existing Device id to update the device. " +  
145 - "Referencing non-existing device Id will cause 'Not Found' error." +  
146 - "\n\nDevice name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the device names and non-unique 'label' field for user-friendly visualization purposes.") 144 + "Device credentials are also generated if not provided in the 'accessToken' request parameter. " +
  145 + "The newly created device id will be present in the response. " +
  146 + "Specify existing Device id to update the device. " +
  147 + "Referencing non-existing device Id will cause 'Not Found' error." +
  148 + "\n\nDevice name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the device names and non-unique 'label' field for user-friendly visualization purposes."
  149 + + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
147 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 150 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
148 @RequestMapping(value = "/device", method = RequestMethod.POST) 151 @RequestMapping(value = "/device", method = RequestMethod.POST)
149 @ResponseBody 152 @ResponseBody
@@ -187,7 +190,7 @@ public class DeviceController extends BaseController { @@ -187,7 +190,7 @@ public class DeviceController extends BaseController {
187 } 190 }
188 191
189 @ApiOperation(value = "Delete device (deleteDevice)", 192 @ApiOperation(value = "Delete device (deleteDevice)",
190 - notes = "Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error.") 193 + notes = "Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error." + TENANT_AUTHORITY_PARAGRAPH)
191 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 194 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
192 @RequestMapping(value = "/device/{deviceId}", method = RequestMethod.DELETE) 195 @RequestMapping(value = "/device/{deviceId}", method = RequestMethod.DELETE)
193 @ResponseStatus(value = HttpStatus.OK) 196 @ResponseStatus(value = HttpStatus.OK)
@@ -219,7 +222,7 @@ public class DeviceController extends BaseController { @@ -219,7 +222,7 @@ public class DeviceController extends BaseController {
219 } 222 }
220 223
221 @ApiOperation(value = "Assign device to customer (assignDeviceToCustomer)", 224 @ApiOperation(value = "Assign device to customer (assignDeviceToCustomer)",
222 - notes = "Creates assignment of the device to customer. Customer will be able to query device afterwards.") 225 + notes = "Creates assignment of the device to customer. Customer will be able to query device afterwards." + TENANT_AUTHORITY_PARAGRAPH)
223 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 226 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
224 @RequestMapping(value = "/customer/{customerId}/device/{deviceId}", method = RequestMethod.POST) 227 @RequestMapping(value = "/customer/{customerId}/device/{deviceId}", method = RequestMethod.POST)
225 @ResponseBody 228 @ResponseBody
@@ -255,7 +258,7 @@ public class DeviceController extends BaseController { @@ -255,7 +258,7 @@ public class DeviceController extends BaseController {
255 } 258 }
256 259
257 @ApiOperation(value = "Unassign device from customer (unassignDeviceFromCustomer)", 260 @ApiOperation(value = "Unassign device from customer (unassignDeviceFromCustomer)",
258 - notes = "Clears assignment of the device to customer. Customer will not be able to query device afterwards.") 261 + notes = "Clears assignment of the device to customer. Customer will not be able to query device afterwards." + TENANT_AUTHORITY_PARAGRAPH)
259 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 262 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
260 @RequestMapping(value = "/customer/device/{deviceId}", method = RequestMethod.DELETE) 263 @RequestMapping(value = "/customer/device/{deviceId}", method = RequestMethod.DELETE)
261 @ResponseBody 264 @ResponseBody
@@ -291,7 +294,7 @@ public class DeviceController extends BaseController { @@ -291,7 +294,7 @@ public class DeviceController extends BaseController {
291 @ApiOperation(value = "Make device publicly available (assignDeviceToPublicCustomer)", 294 @ApiOperation(value = "Make device publicly available (assignDeviceToPublicCustomer)",
292 notes = "Device will be available for non-authorized (not logged-in) users. " + 295 notes = "Device will be available for non-authorized (not logged-in) users. " +
293 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " + 296 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " +
294 - "However, users that are logged-in and belong to different tenant will not be able to access the device.") 297 + "However, users that are logged-in and belong to different tenant will not be able to access the device." + TENANT_AUTHORITY_PARAGRAPH)
295 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 298 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
296 @RequestMapping(value = "/customer/public/device/{deviceId}", method = RequestMethod.POST) 299 @RequestMapping(value = "/customer/public/device/{deviceId}", method = RequestMethod.POST)
297 @ResponseBody 300 @ResponseBody
@@ -318,7 +321,7 @@ public class DeviceController extends BaseController { @@ -318,7 +321,7 @@ public class DeviceController extends BaseController {
318 } 321 }
319 322
320 @ApiOperation(value = "Get Device Credentials (getDeviceCredentialsByDeviceId)", 323 @ApiOperation(value = "Get Device Credentials (getDeviceCredentialsByDeviceId)",
321 - notes = "If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials.") 324 + notes = "If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
322 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 325 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
323 @RequestMapping(value = "/device/{deviceId}/credentials", method = RequestMethod.GET) 326 @RequestMapping(value = "/device/{deviceId}/credentials", method = RequestMethod.GET)
324 @ResponseBody 327 @ResponseBody
@@ -344,7 +347,7 @@ public class DeviceController extends BaseController { @@ -344,7 +347,7 @@ public class DeviceController extends BaseController {
344 @ApiOperation(value = "Update device credentials (updateDeviceCredentials)", notes = "During device creation, platform generates random 'ACCESS_TOKEN' credentials. " + 347 @ApiOperation(value = "Update device credentials (updateDeviceCredentials)", notes = "During device creation, platform generates random 'ACCESS_TOKEN' credentials. " +
345 "Use this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value. " + 348 "Use this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value. " +
346 "Then use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device. " + 349 "Then use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device. " +
347 - "The structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'.") 350 + "The structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'." + TENANT_AUTHORITY_PARAGRAPH)
348 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 351 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
349 @RequestMapping(value = "/device/credentials", method = RequestMethod.POST) 352 @RequestMapping(value = "/device/credentials", method = RequestMethod.POST)
350 @ResponseBody 353 @ResponseBody
@@ -405,7 +408,7 @@ public class DeviceController extends BaseController { @@ -405,7 +408,7 @@ public class DeviceController extends BaseController {
405 408
406 @ApiOperation(value = "Get Tenant Device Infos (getTenantDeviceInfos)", 409 @ApiOperation(value = "Get Tenant Device Infos (getTenantDeviceInfos)",
407 notes = "Returns a page of devices info objects owned by tenant. " + 410 notes = "Returns a page of devices info objects owned by tenant. " +
408 - PAGE_DATA_PARAMETERS + DEVICE_INFO_DESCRIPTION) 411 + PAGE_DATA_PARAMETERS + DEVICE_INFO_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH)
409 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 412 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
410 @RequestMapping(value = "/tenant/deviceInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 413 @RequestMapping(value = "/tenant/deviceInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
411 @ResponseBody 414 @ResponseBody
@@ -443,7 +446,7 @@ public class DeviceController extends BaseController { @@ -443,7 +446,7 @@ public class DeviceController extends BaseController {
443 446
444 @ApiOperation(value = "Get Tenant Device (getTenantDevice)", 447 @ApiOperation(value = "Get Tenant Device (getTenantDevice)",
445 notes = "Requested device must be owned by tenant that the user belongs to. " + 448 notes = "Requested device must be owned by tenant that the user belongs to. " +
446 - "Device name is an unique property of device. So it can be used to identify the device.") 449 + "Device name is an unique property of device. So it can be used to identify the device." + TENANT_AUTHORITY_PARAGRAPH)
447 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 450 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
448 @RequestMapping(value = "/tenant/devices", params = {"deviceName"}, method = RequestMethod.GET) 451 @RequestMapping(value = "/tenant/devices", params = {"deviceName"}, method = RequestMethod.GET)
449 @ResponseBody 452 @ResponseBody
@@ -460,7 +463,7 @@ public class DeviceController extends BaseController { @@ -460,7 +463,7 @@ public class DeviceController extends BaseController {
460 463
461 @ApiOperation(value = "Get Customer Devices (getCustomerDevices)", 464 @ApiOperation(value = "Get Customer Devices (getCustomerDevices)",
462 notes = "Returns a page of devices objects assigned to customer. " + 465 notes = "Returns a page of devices objects assigned to customer. " +
463 - PAGE_DATA_PARAMETERS) 466 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
464 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 467 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
465 @RequestMapping(value = "/customer/{customerId}/devices", params = {"pageSize", "page"}, method = RequestMethod.GET) 468 @RequestMapping(value = "/customer/{customerId}/devices", params = {"pageSize", "page"}, method = RequestMethod.GET)
466 @ResponseBody 469 @ResponseBody
@@ -497,7 +500,7 @@ public class DeviceController extends BaseController { @@ -497,7 +500,7 @@ public class DeviceController extends BaseController {
497 500
498 @ApiOperation(value = "Get Customer Device Infos (getCustomerDeviceInfos)", 501 @ApiOperation(value = "Get Customer Device Infos (getCustomerDeviceInfos)",
499 notes = "Returns a page of devices info objects assigned to customer. " + 502 notes = "Returns a page of devices info objects assigned to customer. " +
500 - PAGE_DATA_PARAMETERS + DEVICE_INFO_DESCRIPTION) 503 + PAGE_DATA_PARAMETERS + DEVICE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
501 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 504 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
502 @RequestMapping(value = "/customer/{customerId}/deviceInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 505 @RequestMapping(value = "/customer/{customerId}/deviceInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
503 @ResponseBody 506 @ResponseBody
@@ -538,7 +541,7 @@ public class DeviceController extends BaseController { @@ -538,7 +541,7 @@ public class DeviceController extends BaseController {
538 } 541 }
539 542
540 @ApiOperation(value = "Get Devices By Ids (getDevicesByIds)", 543 @ApiOperation(value = "Get Devices By Ids (getDevicesByIds)",
541 - notes = "Requested devices must be owned by tenant or assigned to customer which user is performing the request. ") 544 + notes = "Requested devices must be owned by tenant or assigned to customer which user is performing the request. " + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
542 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 545 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
543 @RequestMapping(value = "/devices", params = {"deviceIds"}, method = RequestMethod.GET) 546 @RequestMapping(value = "/devices", params = {"deviceIds"}, method = RequestMethod.GET)
544 @ResponseBody 547 @ResponseBody
@@ -569,7 +572,7 @@ public class DeviceController extends BaseController { @@ -569,7 +572,7 @@ public class DeviceController extends BaseController {
569 @ApiOperation(value = "Find related devices (findByQuery)", 572 @ApiOperation(value = "Find related devices (findByQuery)",
570 notes = "Returns all devices that are related to the specific entity. " + 573 notes = "Returns all devices that are related to the specific entity. " +
571 "The entity id, relation type, device types, depth of the search, and other query parameters defined using complex 'DeviceSearchQuery' object. " + 574 "The entity id, relation type, device types, depth of the search, and other query parameters defined using complex 'DeviceSearchQuery' object. " +
572 - "See 'Model' tab of the Parameters for more info.") 575 + "See 'Model' tab of the Parameters for more info." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
573 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 576 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
574 @RequestMapping(value = "/devices", method = RequestMethod.POST) 577 @RequestMapping(value = "/devices", method = RequestMethod.POST)
575 @ResponseBody 578 @ResponseBody
@@ -597,7 +600,8 @@ public class DeviceController extends BaseController { @@ -597,7 +600,8 @@ public class DeviceController extends BaseController {
597 } 600 }
598 601
599 @ApiOperation(value = "Get Device Types (getDeviceTypes)", 602 @ApiOperation(value = "Get Device Types (getDeviceTypes)",
600 - notes = "Returns a set of unique device profile names based on devices that are either owned by the tenant or assigned to the customer which user is performing the request.") 603 + notes = "Returns a set of unique device profile names based on devices that are either owned by the tenant or assigned to the customer which user is performing the request."
  604 + + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
601 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 605 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
602 @RequestMapping(value = "/device/types", method = RequestMethod.GET) 606 @RequestMapping(value = "/device/types", method = RequestMethod.GET)
603 @ResponseBody 607 @ResponseBody
@@ -618,7 +622,7 @@ public class DeviceController extends BaseController { @@ -618,7 +622,7 @@ public class DeviceController extends BaseController {
618 "Once device is claimed, the customer becomes its owner and customer users may access device data as well as control the device. \n" + 622 "Once device is claimed, the customer becomes its owner and customer users may access device data as well as control the device. \n" +
619 "In order to enable claiming devices feature a system parameter security.claim.allowClaimingByDefault should be set to true, " + 623 "In order to enable claiming devices feature a system parameter security.claim.allowClaimingByDefault should be set to true, " +
620 "otherwise a server-side claimingAllowed attribute with the value true is obligatory for provisioned devices. \n" + 624 "otherwise a server-side claimingAllowed attribute with the value true is obligatory for provisioned devices. \n" +
621 - "See official documentation for more details regarding claiming.") 625 + "See official documentation for more details regarding claiming." + CUSTOMER_AUTHORITY_PARAGRAPH)
622 @PreAuthorize("hasAuthority('CUSTOMER_USER')") 626 @PreAuthorize("hasAuthority('CUSTOMER_USER')")
623 @RequestMapping(value = "/customer/device/{deviceName}/claim", method = RequestMethod.POST) 627 @RequestMapping(value = "/customer/device/{deviceName}/claim", method = RequestMethod.POST)
624 @ResponseBody 628 @ResponseBody
@@ -676,7 +680,8 @@ public class DeviceController extends BaseController { @@ -676,7 +680,8 @@ public class DeviceController extends BaseController {
676 } 680 }
677 681
678 @ApiOperation(value = "Reclaim device (reClaimDevice)", 682 @ApiOperation(value = "Reclaim device (reClaimDevice)",
679 - notes = "Reclaiming means the device will be unassigned from the customer and the device will be available for claiming again.") 683 + notes = "Reclaiming means the device will be unassigned from the customer and the device will be available for claiming again."
  684 + + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
680 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 685 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
681 @RequestMapping(value = "/customer/device/{deviceName}/claim", method = RequestMethod.DELETE) 686 @RequestMapping(value = "/customer/device/{deviceName}/claim", method = RequestMethod.DELETE)
682 @ResponseStatus(value = HttpStatus.OK) 687 @ResponseStatus(value = HttpStatus.OK)
@@ -730,7 +735,7 @@ public class DeviceController extends BaseController { @@ -730,7 +735,7 @@ public class DeviceController extends BaseController {
730 } 735 }
731 736
732 @ApiOperation(value = "Assign device to tenant (assignDeviceToTenant)", 737 @ApiOperation(value = "Assign device to tenant (assignDeviceToTenant)",
733 - notes = "Creates assignment of the device to tenant. Thereafter tenant will be able to reassign the device to a customer.") 738 + notes = "Creates assignment of the device to tenant. Thereafter tenant will be able to reassign the device to a customer." + TENANT_AUTHORITY_PARAGRAPH)
734 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 739 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
735 @RequestMapping(value = "/tenant/{tenantId}/device/{deviceId}", method = RequestMethod.POST) 740 @RequestMapping(value = "/tenant/{tenantId}/device/{deviceId}", method = RequestMethod.POST)
736 @ResponseBody 741 @ResponseBody
@@ -788,7 +793,7 @@ public class DeviceController extends BaseController { @@ -788,7 +793,7 @@ public class DeviceController extends BaseController {
788 EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION + 793 EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION +
789 "Second, remote edge service will receive a copy of assignment device " + 794 "Second, remote edge service will receive a copy of assignment device " +
790 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 795 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
791 - "Third, once device will be delivered to edge service, it's going to be available for usage on remote edge instance.", 796 + "Third, once device will be delivered to edge service, it's going to be available for usage on remote edge instance." + TENANT_AUTHORITY_PARAGRAPH,
792 produces = MediaType.APPLICATION_JSON_VALUE) 797 produces = MediaType.APPLICATION_JSON_VALUE)
793 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 798 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
794 @RequestMapping(value = "/edge/{edgeId}/device/{deviceId}", method = RequestMethod.POST) 799 @RequestMapping(value = "/edge/{edgeId}/device/{deviceId}", method = RequestMethod.POST)
@@ -831,7 +836,7 @@ public class DeviceController extends BaseController { @@ -831,7 +836,7 @@ public class DeviceController extends BaseController {
831 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION + 836 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION +
832 "Second, remote edge service will receive an 'unassign' command to remove device " + 837 "Second, remote edge service will receive an 'unassign' command to remove device " +
833 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 838 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
834 - "Third, once 'unassign' command will be delivered to edge service, it's going to remove device locally.", 839 + "Third, once 'unassign' command will be delivered to edge service, it's going to remove device locally." + TENANT_AUTHORITY_PARAGRAPH,
835 produces = MediaType.APPLICATION_JSON_VALUE) 840 produces = MediaType.APPLICATION_JSON_VALUE)
836 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 841 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
837 @RequestMapping(value = "/edge/{edgeId}/device/{deviceId}", method = RequestMethod.DELETE) 842 @RequestMapping(value = "/edge/{edgeId}/device/{deviceId}", method = RequestMethod.DELETE)
@@ -871,7 +876,7 @@ public class DeviceController extends BaseController { @@ -871,7 +876,7 @@ public class DeviceController extends BaseController {
871 876
872 @ApiOperation(value = "Get devices assigned to edge (getEdgeDevices)", 877 @ApiOperation(value = "Get devices assigned to edge (getEdgeDevices)",
873 notes = "Returns a page of devices assigned to edge. " + 878 notes = "Returns a page of devices assigned to edge. " +
874 - PAGE_DATA_PARAMETERS) 879 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
875 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 880 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
876 @RequestMapping(value = "/edge/{edgeId}/devices", params = {"pageSize", "page"}, method = RequestMethod.GET) 881 @RequestMapping(value = "/edge/{edgeId}/devices", params = {"pageSize", "page"}, method = RequestMethod.GET)
877 @ResponseBody 882 @ResponseBody
@@ -928,7 +933,7 @@ public class DeviceController extends BaseController { @@ -928,7 +933,7 @@ public class DeviceController extends BaseController {
928 notes = "The platform gives an ability to load OTA (over-the-air) packages to devices. " + 933 notes = "The platform gives an ability to load OTA (over-the-air) packages to devices. " +
929 "It can be done in two different ways: device scope or device profile scope." + 934 "It can be done in two different ways: device scope or device profile scope." +
930 "In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. " + 935 "In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. " +
931 - "It can be useful when you want to define number of devices that will be affected with future OTA package") 936 + "It can be useful when you want to define number of devices that will be affected with future OTA package" + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
932 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 937 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
933 @RequestMapping(value = "/devices/count/{otaPackageType}/{deviceProfileId}", method = RequestMethod.GET) 938 @RequestMapping(value = "/devices/count/{otaPackageType}/{deviceProfileId}", method = RequestMethod.GET)
934 @ResponseBody 939 @ResponseBody
@@ -949,7 +954,7 @@ public class DeviceController extends BaseController { @@ -949,7 +954,7 @@ public class DeviceController extends BaseController {
949 } 954 }
950 955
951 @ApiOperation(value = "Import the bulk of devices (processDevicesBulkImport)", 956 @ApiOperation(value = "Import the bulk of devices (processDevicesBulkImport)",
952 - notes = "There's an ability to import the bulk of devices using the only .csv file.") 957 + notes = "There's an ability to import the bulk of devices using the only .csv file." + TENANT_AUTHORITY_PARAGRAPH)
953 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 958 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
954 @PostMapping("/device/bulk_import") 959 @PostMapping("/device/bulk_import")
955 public BulkImportResult<Device> processDevicesBulkImport(@RequestBody BulkImportRequest request) throws Exception { 960 public BulkImportResult<Device> processDevicesBulkImport(@RequestBody BulkImportRequest request) throws Exception {
@@ -81,7 +81,7 @@ public class DeviceProfileController extends BaseController { @@ -81,7 +81,7 @@ public class DeviceProfileController extends BaseController {
81 81
82 @ApiOperation(value = "Get Device Profile Info (getDeviceProfileInfoById)", 82 @ApiOperation(value = "Get Device Profile Info (getDeviceProfileInfoById)",
83 notes = "Fetch the Device Profile Info object based on the provided Device Profile Id. " 83 notes = "Fetch the Device Profile Info object based on the provided Device Profile Id. "
84 - + DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_USER_AUTHORITY_PARAGRAPH, 84 + + DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
85 produces = "application/json") 85 produces = "application/json")
86 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 86 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
87 @RequestMapping(value = "/deviceProfileInfo/{deviceProfileId}", method = RequestMethod.GET) 87 @RequestMapping(value = "/deviceProfileInfo/{deviceProfileId}", method = RequestMethod.GET)
@@ -100,7 +100,7 @@ public class DeviceProfileController extends BaseController { @@ -100,7 +100,7 @@ public class DeviceProfileController extends BaseController {
100 100
101 @ApiOperation(value = "Get Default Device Profile (getDefaultDeviceProfileInfo)", 101 @ApiOperation(value = "Get Default Device Profile (getDefaultDeviceProfileInfo)",
102 notes = "Fetch the Default Device Profile Info object. " + 102 notes = "Fetch the Default Device Profile Info object. " +
103 - DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_USER_AUTHORITY_PARAGRAPH, 103 + DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
104 produces = "application/json") 104 produces = "application/json")
105 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 105 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
106 @RequestMapping(value = "/deviceProfileInfo/default", method = RequestMethod.GET) 106 @RequestMapping(value = "/deviceProfileInfo/default", method = RequestMethod.GET)
@@ -321,7 +321,7 @@ public class DeviceProfileController extends BaseController { @@ -321,7 +321,7 @@ public class DeviceProfileController extends BaseController {
321 321
322 @ApiOperation(value = "Get Device Profiles for transport type (getDeviceProfileInfos)", 322 @ApiOperation(value = "Get Device Profiles for transport type (getDeviceProfileInfos)",
323 notes = "Returns a page of devices profile info objects owned by tenant. " + 323 notes = "Returns a page of devices profile info objects owned by tenant. " +
324 - PAGE_DATA_PARAMETERS + DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_USER_AUTHORITY_PARAGRAPH, 324 + PAGE_DATA_PARAMETERS + DEVICE_PROFILE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
325 produces = "application/json") 325 produces = "application/json")
326 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 326 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
327 @RequestMapping(value = "/deviceProfileInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 327 @RequestMapping(value = "/deviceProfileInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -91,7 +91,7 @@ public class EdgeController extends BaseController { @@ -91,7 +91,7 @@ public class EdgeController extends BaseController {
91 } 91 }
92 92
93 @ApiOperation(value = "Get Edge (getEdgeById)", 93 @ApiOperation(value = "Get Edge (getEdgeById)",
94 - notes = "Get the Edge object based on the provided Edge Id. " + EDGE_SECURITY_CHECK, 94 + notes = "Get the Edge object based on the provided Edge Id. " + EDGE_SECURITY_CHECK + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
95 produces = MediaType.APPLICATION_JSON_VALUE) 95 produces = MediaType.APPLICATION_JSON_VALUE)
96 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 96 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
97 @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.GET) 97 @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.GET)
@@ -112,7 +112,7 @@ public class EdgeController extends BaseController { @@ -112,7 +112,7 @@ public class EdgeController extends BaseController {
112 } 112 }
113 113
114 @ApiOperation(value = "Get Edge Info (getEdgeInfoById)", 114 @ApiOperation(value = "Get Edge Info (getEdgeInfoById)",
115 - notes = "Get the Edge Info object based on the provided Edge Id. " + EDGE_SECURITY_CHECK, 115 + notes = "Get the Edge Info object based on the provided Edge Id. " + EDGE_SECURITY_CHECK + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
116 produces = MediaType.APPLICATION_JSON_VALUE) 116 produces = MediaType.APPLICATION_JSON_VALUE)
117 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 117 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
118 @RequestMapping(value = "/edge/info/{edgeId}", method = RequestMethod.GET) 118 @RequestMapping(value = "/edge/info/{edgeId}", method = RequestMethod.GET)
@@ -137,7 +137,8 @@ public class EdgeController extends BaseController { @@ -137,7 +137,8 @@ public class EdgeController extends BaseController {
137 "The newly created edge id will be present in the response. " + 137 "The newly created edge id will be present in the response. " +
138 "Specify existing Edge id to update the edge. " + 138 "Specify existing Edge id to update the edge. " +
139 "Referencing non-existing Edge Id will cause 'Not Found' error." + 139 "Referencing non-existing Edge Id will cause 'Not Found' error." +
140 - "\n\nEdge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes.", 140 + "\n\nEdge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes."
  141 + + TENANT_AUTHORITY_PARAGRAPH,
141 produces = MediaType.APPLICATION_JSON_VALUE) 142 produces = MediaType.APPLICATION_JSON_VALUE)
142 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 143 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
143 @RequestMapping(value = "/edge", method = RequestMethod.POST) 144 @RequestMapping(value = "/edge", method = RequestMethod.POST)
@@ -187,7 +188,7 @@ public class EdgeController extends BaseController { @@ -187,7 +188,7 @@ public class EdgeController extends BaseController {
187 } 188 }
188 189
189 @ApiOperation(value = "Delete edge (deleteEdge)", 190 @ApiOperation(value = "Delete edge (deleteEdge)",
190 - notes = "Deletes the edge. Referencing non-existing edge Id will cause an error.") 191 + notes = "Deletes the edge. Referencing non-existing edge Id will cause an error."+ TENANT_AUTHORITY_PARAGRAPH)
191 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 192 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
192 @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.DELETE) 193 @RequestMapping(value = "/edge/{edgeId}", method = RequestMethod.DELETE)
193 @ResponseStatus(value = HttpStatus.OK) 194 @ResponseStatus(value = HttpStatus.OK)
@@ -219,7 +220,7 @@ public class EdgeController extends BaseController { @@ -219,7 +220,7 @@ public class EdgeController extends BaseController {
219 220
220 @ApiOperation(value = "Get Tenant Edges (getEdges)", 221 @ApiOperation(value = "Get Tenant Edges (getEdges)",
221 notes = "Returns a page of edges owned by tenant. " + 222 notes = "Returns a page of edges owned by tenant. " +
222 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE) 223 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
223 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 224 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
224 @RequestMapping(value = "/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) 225 @RequestMapping(value = "/edges", params = {"pageSize", "page"}, method = RequestMethod.GET)
225 @ResponseBody 226 @ResponseBody
@@ -243,7 +244,7 @@ public class EdgeController extends BaseController { @@ -243,7 +244,7 @@ public class EdgeController extends BaseController {
243 } 244 }
244 245
245 @ApiOperation(value = "Assign edge to customer (assignEdgeToCustomer)", 246 @ApiOperation(value = "Assign edge to customer (assignEdgeToCustomer)",
246 - notes = "Creates assignment of the edge to customer. Customer will be able to query edge afterwards.", 247 + notes = "Creates assignment of the edge to customer. Customer will be able to query edge afterwards." + TENANT_AUTHORITY_PARAGRAPH,
247 produces = MediaType.APPLICATION_JSON_VALUE) 248 produces = MediaType.APPLICATION_JSON_VALUE)
248 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 249 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
249 @RequestMapping(value = "/customer/{customerId}/edge/{edgeId}", method = RequestMethod.POST) 250 @RequestMapping(value = "/customer/{customerId}/edge/{edgeId}", method = RequestMethod.POST)
@@ -283,7 +284,7 @@ public class EdgeController extends BaseController { @@ -283,7 +284,7 @@ public class EdgeController extends BaseController {
283 } 284 }
284 285
285 @ApiOperation(value = "Unassign edge from customer (unassignEdgeFromCustomer)", 286 @ApiOperation(value = "Unassign edge from customer (unassignEdgeFromCustomer)",
286 - notes = "Clears assignment of the edge to customer. Customer will not be able to query edge afterwards.", 287 + notes = "Clears assignment of the edge to customer. Customer will not be able to query edge afterwards." + TENANT_AUTHORITY_PARAGRAPH,
287 produces = MediaType.APPLICATION_JSON_VALUE) 288 produces = MediaType.APPLICATION_JSON_VALUE)
288 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 289 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
289 @RequestMapping(value = "/customer/edge/{edgeId}", method = RequestMethod.DELETE) 290 @RequestMapping(value = "/customer/edge/{edgeId}", method = RequestMethod.DELETE)
@@ -323,7 +324,7 @@ public class EdgeController extends BaseController { @@ -323,7 +324,7 @@ public class EdgeController extends BaseController {
323 @ApiOperation(value = "Make edge publicly available (assignEdgeToPublicCustomer)", 324 @ApiOperation(value = "Make edge publicly available (assignEdgeToPublicCustomer)",
324 notes = "Edge will be available for non-authorized (not logged-in) users. " + 325 notes = "Edge will be available for non-authorized (not logged-in) users. " +
325 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " + 326 "This is useful to create dashboards that you plan to share/embed on a publicly available website. " +
326 - "However, users that are logged-in and belong to different tenant will not be able to access the edge.", 327 + "However, users that are logged-in and belong to different tenant will not be able to access the edge." + TENANT_AUTHORITY_PARAGRAPH,
327 produces = MediaType.APPLICATION_JSON_VALUE) 328 produces = MediaType.APPLICATION_JSON_VALUE)
328 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 329 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
329 @RequestMapping(value = "/customer/public/edge/{edgeId}", method = RequestMethod.POST) 330 @RequestMapping(value = "/customer/public/edge/{edgeId}", method = RequestMethod.POST)
@@ -355,7 +356,7 @@ public class EdgeController extends BaseController { @@ -355,7 +356,7 @@ public class EdgeController extends BaseController {
355 356
356 @ApiOperation(value = "Get Tenant Edges (getTenantEdges)", 357 @ApiOperation(value = "Get Tenant Edges (getTenantEdges)",
357 notes = "Returns a page of edges owned by tenant. " + 358 notes = "Returns a page of edges owned by tenant. " +
358 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE) 359 + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
359 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 360 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
360 @RequestMapping(value = "/tenant/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) 361 @RequestMapping(value = "/tenant/edges", params = {"pageSize", "page"}, method = RequestMethod.GET)
361 @ResponseBody 362 @ResponseBody
@@ -387,7 +388,7 @@ public class EdgeController extends BaseController { @@ -387,7 +388,7 @@ public class EdgeController extends BaseController {
387 388
388 @ApiOperation(value = "Get Tenant Edge Infos (getTenantEdgeInfos)", 389 @ApiOperation(value = "Get Tenant Edge Infos (getTenantEdgeInfos)",
389 notes = "Returns a page of edges info objects owned by tenant. " + 390 notes = "Returns a page of edges info objects owned by tenant. " +
390 - PAGE_DATA_PARAMETERS + EDGE_INFO_DESCRIPTION, 391 + PAGE_DATA_PARAMETERS + EDGE_INFO_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH,
391 produces = MediaType.APPLICATION_JSON_VALUE) 392 produces = MediaType.APPLICATION_JSON_VALUE)
392 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 393 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
393 @RequestMapping(value = "/tenant/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 394 @RequestMapping(value = "/tenant/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
@@ -420,7 +421,7 @@ public class EdgeController extends BaseController { @@ -420,7 +421,7 @@ public class EdgeController extends BaseController {
420 421
421 @ApiOperation(value = "Get Tenant Edge (getTenantEdge)", 422 @ApiOperation(value = "Get Tenant Edge (getTenantEdge)",
422 notes = "Requested edge must be owned by tenant or customer that the user belongs to. " + 423 notes = "Requested edge must be owned by tenant or customer that the user belongs to. " +
423 - "Edge name is an unique property of edge. So it can be used to identify the edge.", 424 + "Edge name is an unique property of edge. So it can be used to identify the edge." + TENANT_AUTHORITY_PARAGRAPH,
424 produces = MediaType.APPLICATION_JSON_VALUE) 425 produces = MediaType.APPLICATION_JSON_VALUE)
425 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 426 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
426 @RequestMapping(value = "/tenant/edges", params = {"edgeName"}, method = RequestMethod.GET) 427 @RequestMapping(value = "/tenant/edges", params = {"edgeName"}, method = RequestMethod.GET)
@@ -437,7 +438,7 @@ public class EdgeController extends BaseController { @@ -437,7 +438,7 @@ public class EdgeController extends BaseController {
437 438
438 @ApiOperation(value = "Set root rule chain for provided edge (setRootRuleChain)", 439 @ApiOperation(value = "Set root rule chain for provided edge (setRootRuleChain)",
439 notes = "Change root rule chain of the edge to the new provided rule chain. \n" + 440 notes = "Change root rule chain of the edge to the new provided rule chain. \n" +
440 - "This operation will send a notification to update root rule chain on remote edge service.", 441 + "This operation will send a notification to update root rule chain on remote edge service." + TENANT_AUTHORITY_PARAGRAPH,
441 produces = MediaType.APPLICATION_JSON_VALUE) 442 produces = MediaType.APPLICATION_JSON_VALUE)
442 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 443 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
443 @RequestMapping(value = "/edge/{edgeId}/{ruleChainId}/root", method = RequestMethod.POST) 444 @RequestMapping(value = "/edge/{edgeId}/{ruleChainId}/root", method = RequestMethod.POST)
@@ -475,7 +476,7 @@ public class EdgeController extends BaseController { @@ -475,7 +476,7 @@ public class EdgeController extends BaseController {
475 476
476 @ApiOperation(value = "Get Customer Edges (getCustomerEdges)", 477 @ApiOperation(value = "Get Customer Edges (getCustomerEdges)",
477 notes = "Returns a page of edges objects assigned to customer. " + 478 notes = "Returns a page of edges objects assigned to customer. " +
478 - PAGE_DATA_PARAMETERS, produces = MediaType.APPLICATION_JSON_VALUE) 479 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
479 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 480 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
480 @RequestMapping(value = "/customer/{customerId}/edges", params = {"pageSize", "page"}, method = RequestMethod.GET) 481 @RequestMapping(value = "/customer/{customerId}/edges", params = {"pageSize", "page"}, method = RequestMethod.GET)
481 @ResponseBody 482 @ResponseBody
@@ -520,7 +521,7 @@ public class EdgeController extends BaseController { @@ -520,7 +521,7 @@ public class EdgeController extends BaseController {
520 521
521 @ApiOperation(value = "Get Customer Edge Infos (getCustomerEdgeInfos)", 522 @ApiOperation(value = "Get Customer Edge Infos (getCustomerEdgeInfos)",
522 notes = "Returns a page of edges info objects assigned to customer. " + 523 notes = "Returns a page of edges info objects assigned to customer. " +
523 - PAGE_DATA_PARAMETERS + EDGE_INFO_DESCRIPTION, produces = MediaType.APPLICATION_JSON_VALUE) 524 + PAGE_DATA_PARAMETERS + EDGE_INFO_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH, produces = MediaType.APPLICATION_JSON_VALUE)
524 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 525 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
525 @RequestMapping(value = "/customer/{customerId}/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET) 526 @RequestMapping(value = "/customer/{customerId}/edgeInfos", params = {"pageSize", "page"}, method = RequestMethod.GET)
526 @ResponseBody 527 @ResponseBody
@@ -564,7 +565,7 @@ public class EdgeController extends BaseController { @@ -564,7 +565,7 @@ public class EdgeController extends BaseController {
564 } 565 }
565 566
566 @ApiOperation(value = "Get Edges By Ids (getEdgesByIds)", 567 @ApiOperation(value = "Get Edges By Ids (getEdgesByIds)",
567 - notes = "Requested edges must be owned by tenant or assigned to customer which user is performing the request.", 568 + notes = "Requested edges must be owned by tenant or assigned to customer which user is performing the request." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
568 produces = MediaType.APPLICATION_JSON_VALUE) 569 produces = MediaType.APPLICATION_JSON_VALUE)
569 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 570 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
570 @RequestMapping(value = "/edges", params = {"edgeIds"}, method = RequestMethod.GET) 571 @RequestMapping(value = "/edges", params = {"edgeIds"}, method = RequestMethod.GET)
@@ -602,7 +603,7 @@ public class EdgeController extends BaseController { @@ -602,7 +603,7 @@ public class EdgeController extends BaseController {
602 @ApiOperation(value = "Find related edges (findByQuery)", 603 @ApiOperation(value = "Find related edges (findByQuery)",
603 notes = "Returns all edges that are related to the specific entity. " + 604 notes = "Returns all edges that are related to the specific entity. " +
604 "The entity id, relation type, edge types, depth of the search, and other query parameters defined using complex 'EdgeSearchQuery' object. " + 605 "The entity id, relation type, edge types, depth of the search, and other query parameters defined using complex 'EdgeSearchQuery' object. " +
605 - "See 'Model' tab of the Parameters for more info.", 606 + "See 'Model' tab of the Parameters for more info." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
606 produces = MediaType.APPLICATION_JSON_VALUE) 607 produces = MediaType.APPLICATION_JSON_VALUE)
607 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 608 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
608 @RequestMapping(value = "/edges", method = RequestMethod.POST) 609 @RequestMapping(value = "/edges", method = RequestMethod.POST)
@@ -636,7 +637,8 @@ public class EdgeController extends BaseController { @@ -636,7 +637,8 @@ public class EdgeController extends BaseController {
636 } 637 }
637 638
638 @ApiOperation(value = "Get Edge Types (getEdgeTypes)", 639 @ApiOperation(value = "Get Edge Types (getEdgeTypes)",
639 - notes = "Returns a set of unique edge types based on edges that are either owned by the tenant or assigned to the customer which user is performing the request.", 640 + notes = "Returns a set of unique edge types based on edges that are either owned by the tenant or assigned to the customer which user is performing the request."
  641 + + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
640 produces = MediaType.APPLICATION_JSON_VALUE) 642 produces = MediaType.APPLICATION_JSON_VALUE)
641 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 643 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
642 @RequestMapping(value = "/edge/types", method = RequestMethod.GET) 644 @RequestMapping(value = "/edge/types", method = RequestMethod.GET)
@@ -654,7 +656,7 @@ public class EdgeController extends BaseController { @@ -654,7 +656,7 @@ public class EdgeController extends BaseController {
654 656
655 @ApiOperation(value = "Sync edge (syncEdge)", 657 @ApiOperation(value = "Sync edge (syncEdge)",
656 notes = "Starts synchronization process between edge and cloud. \n" + 658 notes = "Starts synchronization process between edge and cloud. \n" +
657 - "All entities that are assigned to particular edge are going to be send to remote edge service.") 659 + "All entities that are assigned to particular edge are going to be send to remote edge service." + TENANT_AUTHORITY_PARAGRAPH)
658 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 660 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
659 @RequestMapping(value = "/edge/sync/{edgeId}", method = RequestMethod.POST) 661 @RequestMapping(value = "/edge/sync/{edgeId}", method = RequestMethod.POST)
660 public void syncEdge(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION, required = true) 662 public void syncEdge(@ApiParam(value = EDGE_ID_PARAM_DESCRIPTION, required = true)
@@ -676,7 +678,7 @@ public class EdgeController extends BaseController { @@ -676,7 +678,7 @@ public class EdgeController extends BaseController {
676 } 678 }
677 679
678 @ApiOperation(value = "Find missing rule chains (findMissingToRelatedRuleChains)", 680 @ApiOperation(value = "Find missing rule chains (findMissingToRelatedRuleChains)",
679 - notes = "Returns list of rule chains ids that are not assigned to particular edge, but these rule chains are present in the already assigned rule chains to edge.") 681 + notes = "Returns list of rule chains ids that are not assigned to particular edge, but these rule chains are present in the already assigned rule chains to edge." + TENANT_AUTHORITY_PARAGRAPH)
680 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 682 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
681 @RequestMapping(value = "/edge/missingToRelatedRuleChains/{edgeId}", method = RequestMethod.GET) 683 @RequestMapping(value = "/edge/missingToRelatedRuleChains/{edgeId}", method = RequestMethod.GET)
682 @ResponseBody 684 @ResponseBody
@@ -694,7 +696,7 @@ public class EdgeController extends BaseController { @@ -694,7 +696,7 @@ public class EdgeController extends BaseController {
694 } 696 }
695 697
696 @ApiOperation(value = "Import the bulk of edges (processEdgesBulkImport)", 698 @ApiOperation(value = "Import the bulk of edges (processEdgesBulkImport)",
697 - notes = "There's an ability to import the bulk of edges using the only .csv file.", 699 + notes = "There's an ability to import the bulk of edges using the only .csv file." + TENANT_AUTHORITY_PARAGRAPH,
698 produces = MediaType.APPLICATION_JSON_VALUE) 700 produces = MediaType.APPLICATION_JSON_VALUE)
699 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 701 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
700 @PostMapping("/edge/bulk_import") 702 @PostMapping("/edge/bulk_import")
@@ -497,7 +497,7 @@ public class EntityQueryController extends BaseController { @@ -497,7 +497,7 @@ public class EntityQueryController extends BaseController {
497 "\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:" + 497 "\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:" +
498 ENTITY_FILTERS + 498 ENTITY_FILTERS +
499 KEY_FILTERS + 499 KEY_FILTERS +
500 - TENANT_OR_USER_AUTHORITY_PARAGRAPH;; 500 + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;;
501 501
502 private static final String ENTITY_DATA_QUERY_DESCRIPTION = 502 private static final String ENTITY_DATA_QUERY_DESCRIPTION =
503 "Allows to run complex queries over platform entities (devices, assets, customers, etc) " + 503 "Allows to run complex queries over platform entities (devices, assets, customers, etc) " +
@@ -580,7 +580,7 @@ public class EntityQueryController extends BaseController { @@ -580,7 +580,7 @@ public class EntityQueryController extends BaseController {
580 "\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:" + 580 "\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:" +
581 ENTITY_FILTERS + 581 ENTITY_FILTERS +
582 KEY_FILTERS + 582 KEY_FILTERS +
583 - TENANT_OR_USER_AUTHORITY_PARAGRAPH; 583 + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;
584 584
585 585
586 private static final String ALARM_DATA_QUERY_DESCRIPTION = "This method description defines how Alarm Data Query extends the Entity Data Query. " + 586 private static final String ALARM_DATA_QUERY_DESCRIPTION = "This method description defines how Alarm Data Query extends the Entity Data Query. " +
@@ -45,7 +45,7 @@ public class OAuth2ConfigTemplateController extends BaseController { @@ -45,7 +45,7 @@ public class OAuth2ConfigTemplateController extends BaseController {
45 45
46 private static final String OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION = "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients"; 46 private static final String OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION = "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients";
47 47
48 - @ApiOperation(value = "Create or update OAuth2 client registration template (saveClientRegistrationTemplate)", 48 + @ApiOperation(value = "Create or update OAuth2 client registration template (saveClientRegistrationTemplate)" + SYSTEM_AUTHORITY_PARAGRAPH,
49 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION) 49 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION)
50 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')") 50 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
51 @RequestMapping(method = RequestMethod.POST) 51 @RequestMapping(method = RequestMethod.POST)
@@ -59,7 +59,7 @@ public class OAuth2ConfigTemplateController extends BaseController { @@ -59,7 +59,7 @@ public class OAuth2ConfigTemplateController extends BaseController {
59 } 59 }
60 } 60 }
61 61
62 - @ApiOperation(value = "Delete OAuth2 client registration template by id (deleteClientRegistrationTemplate)", 62 + @ApiOperation(value = "Delete OAuth2 client registration template by id (deleteClientRegistrationTemplate)" + SYSTEM_AUTHORITY_PARAGRAPH,
63 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION) 63 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION)
64 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')") 64 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
65 @RequestMapping(value = "/{clientRegistrationTemplateId}", method = RequestMethod.DELETE) 65 @RequestMapping(value = "/{clientRegistrationTemplateId}", method = RequestMethod.DELETE)
@@ -76,7 +76,7 @@ public class OAuth2ConfigTemplateController extends BaseController { @@ -76,7 +76,7 @@ public class OAuth2ConfigTemplateController extends BaseController {
76 } 76 }
77 } 77 }
78 78
79 - @ApiOperation(value = "Get the list of all OAuth2 client registration templates (getClientRegistrationTemplates)", 79 + @ApiOperation(value = "Get the list of all OAuth2 client registration templates (getClientRegistrationTemplates)" + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH,
80 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION) 80 notes = OAUTH2_CLIENT_REGISTRATION_TEMPLATE_DEFINITION)
81 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')") 81 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
82 @RequestMapping(method = RequestMethod.GET, produces = "application/json") 82 @RequestMapping(method = RequestMethod.GET, produces = "application/json")
@@ -88,7 +88,7 @@ public class OAuth2Controller extends BaseController { @@ -88,7 +88,7 @@ public class OAuth2Controller extends BaseController {
88 } 88 }
89 } 89 }
90 90
91 - @ApiOperation(value = "Get current OAuth2 settings (getCurrentOAuth2Info)") 91 + @ApiOperation(value = "Get current OAuth2 settings (getCurrentOAuth2Info)", notes = SYSTEM_AUTHORITY_PARAGRAPH)
92 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')") 92 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
93 @RequestMapping(value = "/oauth2/config", method = RequestMethod.GET, produces = "application/json") 93 @RequestMapping(value = "/oauth2/config", method = RequestMethod.GET, produces = "application/json")
94 @ResponseBody 94 @ResponseBody
@@ -101,7 +101,7 @@ public class OAuth2Controller extends BaseController { @@ -101,7 +101,7 @@ public class OAuth2Controller extends BaseController {
101 } 101 }
102 } 102 }
103 103
104 - @ApiOperation(value = "Save OAuth2 settings (saveOAuth2Info)") 104 + @ApiOperation(value = "Save OAuth2 settings (saveOAuth2Info)", notes = SYSTEM_AUTHORITY_PARAGRAPH)
105 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')") 105 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
106 @RequestMapping(value = "/oauth2/config", method = RequestMethod.POST) 106 @RequestMapping(value = "/oauth2/config", method = RequestMethod.POST)
107 @ResponseStatus(value = HttpStatus.OK) 107 @ResponseStatus(value = HttpStatus.OK)
@@ -118,7 +118,7 @@ public class OAuth2Controller extends BaseController { @@ -118,7 +118,7 @@ public class OAuth2Controller extends BaseController {
118 @ApiOperation(value = "Get OAuth2 log in processing URL (getLoginProcessingUrl)", notes = "Returns the URL enclosed in " + 118 @ApiOperation(value = "Get OAuth2 log in processing URL (getLoginProcessingUrl)", notes = "Returns the URL enclosed in " +
119 "double quotes. After successful authentication with OAuth2 provider, it makes a redirect to this path so that the platform can do " + 119 "double quotes. After successful authentication with OAuth2 provider, it makes a redirect to this path so that the platform can do " +
120 "further log in processing. This URL may be configured as 'security.oauth2.loginProcessingUrl' property in yml configuration file, or " + 120 "further log in processing. This URL may be configured as 'security.oauth2.loginProcessingUrl' property in yml configuration file, or " +
121 - "as 'SECURITY_OAUTH2_LOGIN_PROCESSING_URL' env variable. By default it is '/login/oauth2/code/'") 121 + "as 'SECURITY_OAUTH2_LOGIN_PROCESSING_URL' env variable. By default it is '/login/oauth2/code/'" + SYSTEM_AUTHORITY_PARAGRAPH)
122 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')") 122 @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
123 @RequestMapping(value = "/oauth2/loginProcessingUrl", method = RequestMethod.GET) 123 @RequestMapping(value = "/oauth2/loginProcessingUrl", method = RequestMethod.GET)
124 @ResponseBody 124 @ResponseBody
@@ -40,7 +40,7 @@ import java.util.UUID; @@ -40,7 +40,7 @@ import java.util.UUID;
40 @Slf4j 40 @Slf4j
41 public class RpcV1Controller extends AbstractRpcController { 41 public class RpcV1Controller extends AbstractRpcController {
42 42
43 - @ApiOperation(value = "Send one-way RPC request (handleOneWayDeviceRPCRequest)", notes = "Deprecated. See 'Rpc V 2 Controller' instead.") 43 + @ApiOperation(value = "Send one-way RPC request (handleOneWayDeviceRPCRequest)", notes = "Deprecated. See 'Rpc V 2 Controller' instead." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
44 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 44 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
45 @RequestMapping(value = "/oneway/{deviceId}", method = RequestMethod.POST) 45 @RequestMapping(value = "/oneway/{deviceId}", method = RequestMethod.POST)
46 @ResponseBody 46 @ResponseBody
@@ -52,7 +52,7 @@ public class RpcV1Controller extends AbstractRpcController { @@ -52,7 +52,7 @@ public class RpcV1Controller extends AbstractRpcController {
52 return handleDeviceRPCRequest(true, new DeviceId(UUID.fromString(deviceIdStr)), requestBody, HttpStatus.REQUEST_TIMEOUT, HttpStatus.CONFLICT); 52 return handleDeviceRPCRequest(true, new DeviceId(UUID.fromString(deviceIdStr)), requestBody, HttpStatus.REQUEST_TIMEOUT, HttpStatus.CONFLICT);
53 } 53 }
54 54
55 - @ApiOperation(value = "Send two-way RPC request (handleTwoWayDeviceRPCRequest)", notes = "Deprecated. See 'Rpc V 2 Controller' instead.") 55 + @ApiOperation(value = "Send two-way RPC request (handleTwoWayDeviceRPCRequest)", notes = "Deprecated. See 'Rpc V 2 Controller' instead." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
56 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 56 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
57 @RequestMapping(value = "/twoway/{deviceId}", method = RequestMethod.POST) 57 @RequestMapping(value = "/twoway/{deviceId}", method = RequestMethod.POST)
58 @ResponseBody 58 @ResponseBody
@@ -91,9 +91,9 @@ public class RpcV2Controller extends AbstractRpcController { @@ -91,9 +91,9 @@ public class RpcV2Controller extends AbstractRpcController {
91 "In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, " + 91 "In case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, " +
92 "the result of this call is the response from device, or 504 Gateway Timeout if device is offline."; 92 "the result of this call is the response from device, or 504 Gateway Timeout if device is offline.";
93 93
94 - private static final String ONE_WAY_RPC_REQUEST_DESCRIPTION = "Sends the one-way remote-procedure call (RPC) request to device. " + RPC_REQUEST_DESCRIPTION + ONE_WAY_RPC_RESULT + TENANT_OR_USER_AUTHORITY_PARAGRAPH; 94 + private static final String ONE_WAY_RPC_REQUEST_DESCRIPTION = "Sends the one-way remote-procedure call (RPC) request to device. " + RPC_REQUEST_DESCRIPTION + ONE_WAY_RPC_RESULT + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;
95 95
96 - private static final String TWO_WAY_RPC_REQUEST_DESCRIPTION = "Sends the two-way remote-procedure call (RPC) request to device. " + RPC_REQUEST_DESCRIPTION + TWO_WAY_RPC_RESULT + TENANT_OR_USER_AUTHORITY_PARAGRAPH; 96 + private static final String TWO_WAY_RPC_REQUEST_DESCRIPTION = "Sends the two-way remote-procedure call (RPC) request to device. " + RPC_REQUEST_DESCRIPTION + TWO_WAY_RPC_RESULT + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH;
97 97
98 @ApiOperation(value = "Send one-way RPC request", notes = ONE_WAY_RPC_REQUEST_DESCRIPTION) 98 @ApiOperation(value = "Send one-way RPC request", notes = ONE_WAY_RPC_REQUEST_DESCRIPTION)
99 @ApiResponses(value = { 99 @ApiResponses(value = {
@@ -131,7 +131,7 @@ public class RpcV2Controller extends AbstractRpcController { @@ -131,7 +131,7 @@ public class RpcV2Controller extends AbstractRpcController {
131 return handleDeviceRPCRequest(false, new DeviceId(UUID.fromString(deviceIdStr)), requestBody, HttpStatus.GATEWAY_TIMEOUT, HttpStatus.GATEWAY_TIMEOUT); 131 return handleDeviceRPCRequest(false, new DeviceId(UUID.fromString(deviceIdStr)), requestBody, HttpStatus.GATEWAY_TIMEOUT, HttpStatus.GATEWAY_TIMEOUT);
132 } 132 }
133 133
134 - @ApiOperation(value = "Get persistent RPC request", notes = "Get information about the status of the RPC call." + TENANT_OR_USER_AUTHORITY_PARAGRAPH) 134 + @ApiOperation(value = "Get persistent RPC request", notes = "Get information about the status of the RPC call." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
135 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 135 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
136 @RequestMapping(value = "/persistent/{rpcId}", method = RequestMethod.GET) 136 @RequestMapping(value = "/persistent/{rpcId}", method = RequestMethod.GET)
137 @ResponseBody 137 @ResponseBody
@@ -147,7 +147,7 @@ public class RpcV2Controller extends AbstractRpcController { @@ -147,7 +147,7 @@ public class RpcV2Controller extends AbstractRpcController {
147 } 147 }
148 } 148 }
149 149
150 - @ApiOperation(value = "Get persistent RPC requests", notes = "Allows to query RPC calls for specific device using pagination." + TENANT_OR_USER_AUTHORITY_PARAGRAPH) 150 + @ApiOperation(value = "Get persistent RPC requests", notes = "Allows to query RPC calls for specific device using pagination." + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
151 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 151 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
152 @RequestMapping(value = "/persistent/device/{deviceId}", method = RequestMethod.GET) 152 @RequestMapping(value = "/persistent/device/{deviceId}", method = RequestMethod.GET)
153 @ResponseBody 153 @ResponseBody
@@ -169,7 +169,7 @@ public class RuleChainController extends BaseController { @@ -169,7 +169,7 @@ public class RuleChainController extends BaseController {
169 "The newly created Rule Chain Id will be present in the response. " + 169 "The newly created Rule Chain Id will be present in the response. " +
170 "Specify existing Rule Chain id to update the rule chain. " + 170 "Specify existing Rule Chain id to update the rule chain. " +
171 "Referencing non-existing rule chain Id will cause 'Not Found' error." + 171 "Referencing non-existing rule chain Id will cause 'Not Found' error." +
172 - "\n\n" + RULE_CHAIN_DESCRIPTION) 172 + "\n\n" + RULE_CHAIN_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH)
173 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 173 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
174 @RequestMapping(value = "/ruleChain", method = RequestMethod.POST) 174 @RequestMapping(value = "/ruleChain", method = RequestMethod.POST)
175 @ResponseBody 175 @ResponseBody
@@ -327,7 +327,7 @@ public class RuleChainController extends BaseController { @@ -327,7 +327,7 @@ public class RuleChainController extends BaseController {
327 327
328 328
329 @ApiOperation(value = "Get Rule Chains (getRuleChains)", 329 @ApiOperation(value = "Get Rule Chains (getRuleChains)",
330 - notes = "Returns a page of Rule Chains owned by tenant. " + RULE_CHAIN_DESCRIPTION + PAGE_DATA_PARAMETERS) 330 + notes = "Returns a page of Rule Chains owned by tenant. " + RULE_CHAIN_DESCRIPTION + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH)
331 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 331 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
332 @RequestMapping(value = "/ruleChains", params = {"pageSize", "page"}, method = RequestMethod.GET) 332 @RequestMapping(value = "/ruleChains", params = {"pageSize", "page"}, method = RequestMethod.GET)
333 @ResponseBody 333 @ResponseBody
@@ -358,7 +358,8 @@ public class RuleChainController extends BaseController { @@ -358,7 +358,8 @@ public class RuleChainController extends BaseController {
358 } 358 }
359 359
360 @ApiOperation(value = "Delete rule chain (deleteRuleChain)", 360 @ApiOperation(value = "Delete rule chain (deleteRuleChain)",
361 - notes = "Deletes the rule chain. Referencing non-existing rule chain Id will cause an error. Referencing rule chain that is used in the device profiles will cause an error.") 361 + notes = "Deletes the rule chain. Referencing non-existing rule chain Id will cause an error. " +
  362 + "Referencing rule chain that is used in the device profiles will cause an error." + TENANT_AUTHORITY_PARAGRAPH)
362 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 363 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
363 @RequestMapping(value = "/ruleChain/{ruleChainId}", method = RequestMethod.DELETE) 364 @RequestMapping(value = "/ruleChain/{ruleChainId}", method = RequestMethod.DELETE)
364 @ResponseStatus(value = HttpStatus.OK) 365 @ResponseStatus(value = HttpStatus.OK)
@@ -409,7 +410,7 @@ public class RuleChainController extends BaseController { @@ -409,7 +410,7 @@ public class RuleChainController extends BaseController {
409 410
410 @ApiOperation(value = "Get latest input message (getLatestRuleNodeDebugInput)", 411 @ApiOperation(value = "Get latest input message (getLatestRuleNodeDebugInput)",
411 notes = "Gets the input message from the debug events for specified Rule Chain Id. " + 412 notes = "Gets the input message from the debug events for specified Rule Chain Id. " +
412 - "Referencing non-existing rule chain Id will cause an error. ") 413 + "Referencing non-existing rule chain Id will cause an error. " + TENANT_AUTHORITY_PARAGRAPH)
413 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") 414 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
414 @RequestMapping(value = "/ruleNode/{ruleNodeId}/debugIn", method = RequestMethod.GET) 415 @RequestMapping(value = "/ruleNode/{ruleNodeId}/debugIn", method = RequestMethod.GET)
415 @ResponseBody 416 @ResponseBody
@@ -582,7 +583,7 @@ public class RuleChainController extends BaseController { @@ -582,7 +583,7 @@ public class RuleChainController extends BaseController {
582 "Second, remote edge service will receive a copy of assignment rule chain " + 583 "Second, remote edge service will receive a copy of assignment rule chain " +
583 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 584 EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
584 "Third, once rule chain will be delivered to edge service, it's going to start processing messages locally. " + 585 "Third, once rule chain will be delivered to edge service, it's going to start processing messages locally. " +
585 - "\n\nOnly rule chain with type 'EDGE' can be assigned to edge.", 586 + "\n\nOnly rule chain with type 'EDGE' can be assigned to edge." + TENANT_AUTHORITY_PARAGRAPH,
586 produces = MediaType.APPLICATION_JSON_VALUE) 587 produces = MediaType.APPLICATION_JSON_VALUE)
587 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 588 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
588 @RequestMapping(value = "/edge/{edgeId}/ruleChain/{ruleChainId}", method = RequestMethod.POST) 589 @RequestMapping(value = "/edge/{edgeId}/ruleChain/{ruleChainId}", method = RequestMethod.POST)
@@ -622,7 +623,7 @@ public class RuleChainController extends BaseController { @@ -622,7 +623,7 @@ public class RuleChainController extends BaseController {
622 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION + 623 EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION +
623 "Second, remote edge service will receive an 'unassign' command to remove rule chain " + 624 "Second, remote edge service will receive an 'unassign' command to remove rule chain " +
624 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " + 625 EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION + ". " +
625 - "Third, once 'unassign' command will be delivered to edge service, it's going to remove rule chain locally.", 626 + "Third, once 'unassign' command will be delivered to edge service, it's going to remove rule chain locally." + TENANT_AUTHORITY_PARAGRAPH,
626 produces = MediaType.APPLICATION_JSON_VALUE) 627 produces = MediaType.APPLICATION_JSON_VALUE)
627 @PreAuthorize("hasAuthority('TENANT_ADMIN')") 628 @PreAuthorize("hasAuthority('TENANT_ADMIN')")
628 @RequestMapping(value = "/edge/{edgeId}/ruleChain/{ruleChainId}", method = RequestMethod.DELETE) 629 @RequestMapping(value = "/edge/{edgeId}/ruleChain/{ruleChainId}", method = RequestMethod.DELETE)
@@ -182,7 +182,8 @@ public class TelemetryController extends BaseController { @@ -182,7 +182,8 @@ public class TelemetryController extends BaseController {
182 @ApiOperation(value = "Get all attribute keys (getAttributeKeys)", 182 @ApiOperation(value = "Get all attribute keys (getAttributeKeys)",
183 notes = "Returns a list of all attribute key names for the selected entity. " + 183 notes = "Returns a list of all attribute key names for the selected entity. " +
184 "In the case of device entity specified, a response will include merged attribute key names list from each scope: " + 184 "In the case of device entity specified, a response will include merged attribute key names list from each scope: " +
185 - "SERVER_SCOPE, CLIENT_SCOPE, SHARED_SCOPE. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 185 + "SERVER_SCOPE, CLIENT_SCOPE, SHARED_SCOPE. "
  186 + + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
186 produces = MediaType.APPLICATION_JSON_VALUE) 187 produces = MediaType.APPLICATION_JSON_VALUE)
187 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 188 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
188 @RequestMapping(value = "/{entityType}/{entityId}/keys/attributes", method = RequestMethod.GET) 189 @RequestMapping(value = "/{entityType}/{entityId}/keys/attributes", method = RequestMethod.GET)
@@ -195,7 +196,8 @@ public class TelemetryController extends BaseController { @@ -195,7 +196,8 @@ public class TelemetryController extends BaseController {
195 196
196 @ApiOperation(value = "Get all attributes keys by scope (getAttributeKeysByScope)", 197 @ApiOperation(value = "Get all attributes keys by scope (getAttributeKeysByScope)",
197 notes = "Returns a list of attribute key names from the specified attributes scope for the selected entity. " + 198 notes = "Returns a list of attribute key names from the specified attributes scope for the selected entity. " +
198 - "If scope parameter is omitted, Get all attribute keys(getAttributeKeys) API will be called. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 199 + "If scope parameter is omitted, Get all attribute keys(getAttributeKeys) API will be called. "
  200 + + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
199 produces = MediaType.APPLICATION_JSON_VALUE) 201 produces = MediaType.APPLICATION_JSON_VALUE)
200 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 202 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
201 @RequestMapping(value = "/{entityType}/{entityId}/keys/attributes/{scope}", method = RequestMethod.GET) 203 @RequestMapping(value = "/{entityType}/{entityId}/keys/attributes/{scope}", method = RequestMethod.GET)
@@ -210,7 +212,7 @@ public class TelemetryController extends BaseController { @@ -210,7 +212,7 @@ public class TelemetryController extends BaseController {
210 212
211 @ApiOperation(value = "Get attributes (getAttributes)", 213 @ApiOperation(value = "Get attributes (getAttributes)",
212 notes = GET_ALL_ATTRIBUTES_BASE_DESCRIPTION + " If 'keys' parameter is omitted, AttributeData class objects will be added to the response for all existing keys of the selected entity. " + 214 notes = GET_ALL_ATTRIBUTES_BASE_DESCRIPTION + " If 'keys' parameter is omitted, AttributeData class objects will be added to the response for all existing keys of the selected entity. " +
213 - INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 215 + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
214 produces = MediaType.APPLICATION_JSON_VALUE) 216 produces = MediaType.APPLICATION_JSON_VALUE)
215 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 217 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
216 @RequestMapping(value = "/{entityType}/{entityId}/values/attributes", method = RequestMethod.GET) 218 @RequestMapping(value = "/{entityType}/{entityId}/values/attributes", method = RequestMethod.GET)
@@ -228,7 +230,7 @@ public class TelemetryController extends BaseController { @@ -228,7 +230,7 @@ public class TelemetryController extends BaseController {
228 notes = GET_ALL_ATTRIBUTES_BY_SCOPE_BASE_DESCRIPTION + " In case that 'keys' parameter is not selected, " + 230 notes = GET_ALL_ATTRIBUTES_BY_SCOPE_BASE_DESCRIPTION + " In case that 'keys' parameter is not selected, " +
229 "AttributeData class objects will be added to the response for all existing attribute keys from the " + 231 "AttributeData class objects will be added to the response for all existing attribute keys from the " +
230 "specified attributes scope of the selected entity. If 'scope' parameter is omitted, " + 232 "specified attributes scope of the selected entity. If 'scope' parameter is omitted, " +
231 - "Get attributes (getAttributes) API will be called. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 233 + "Get attributes (getAttributes) API will be called. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
232 produces = MediaType.APPLICATION_JSON_VALUE) 234 produces = MediaType.APPLICATION_JSON_VALUE)
233 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 235 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
234 @RequestMapping(value = "/{entityType}/{entityId}/values/attributes/{scope}", method = RequestMethod.GET) 236 @RequestMapping(value = "/{entityType}/{entityId}/values/attributes/{scope}", method = RequestMethod.GET)
@@ -245,7 +247,7 @@ public class TelemetryController extends BaseController { @@ -245,7 +247,7 @@ public class TelemetryController extends BaseController {
245 247
246 @ApiOperation(value = "Get timeseries keys (getTimeseriesKeys)", 248 @ApiOperation(value = "Get timeseries keys (getTimeseriesKeys)",
247 notes = "Returns a list of all telemetry key names for the selected entity based on entity id and entity type specified. " + 249 notes = "Returns a list of all telemetry key names for the selected entity based on entity id and entity type specified. " +
248 - INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 250 + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
249 produces = MediaType.APPLICATION_JSON_VALUE) 251 produces = MediaType.APPLICATION_JSON_VALUE)
250 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 252 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
251 @RequestMapping(value = "/{entityType}/{entityId}/keys/timeseries", method = RequestMethod.GET) 253 @RequestMapping(value = "/{entityType}/{entityId}/keys/timeseries", method = RequestMethod.GET)
@@ -259,7 +261,8 @@ public class TelemetryController extends BaseController { @@ -259,7 +261,8 @@ public class TelemetryController extends BaseController {
259 261
260 @ApiOperation(value = "Get latest timeseries (getLatestTimeseries)", 262 @ApiOperation(value = "Get latest timeseries (getLatestTimeseries)",
261 notes = "Returns a JSON structure that represents a Map, where the map key is a telemetry key name " + 263 notes = "Returns a JSON structure that represents a Map, where the map key is a telemetry key name " +
262 - "and map value - is a singleton list of TsData class objects. " + TS_DATA_CLASS_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 264 + "and map value - is a singleton list of TsData class objects. "
  265 + + TS_DATA_CLASS_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
263 produces = MediaType.APPLICATION_JSON_VALUE) 266 produces = MediaType.APPLICATION_JSON_VALUE)
264 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 267 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
265 @RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET) 268 @RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET)
@@ -280,7 +283,8 @@ public class TelemetryController extends BaseController { @@ -280,7 +283,8 @@ public class TelemetryController extends BaseController {
280 "and map value - is a list of TsData class objects. " + TS_DATA_CLASS_DESCRIPTION + 283 "and map value - is a list of TsData class objects. " + TS_DATA_CLASS_DESCRIPTION +
281 "This method allows us to group original data into intervals and aggregate it using one of the aggregation methods or just limit the number of TsData objects to fetch for each key specified. " + 284 "This method allows us to group original data into intervals and aggregate it using one of the aggregation methods or just limit the number of TsData objects to fetch for each key specified. " +
282 "See the desription of the request parameters for more details. " + 285 "See the desription of the request parameters for more details. " +
283 - "The result can also be sorted in ascending or descending order. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 286 + "The result can also be sorted in ascending or descending order. "
  287 + + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
284 produces = MediaType.APPLICATION_JSON_VALUE) 288 produces = MediaType.APPLICATION_JSON_VALUE)
285 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") 289 @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
286 @RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET, params = {"keys", "startTs", "endTs"}) 290 @RequestMapping(value = "/{entityType}/{entityId}/values/timeseries", method = RequestMethod.GET, params = {"keys", "startTs", "endTs"})
@@ -321,7 +325,7 @@ public class TelemetryController extends BaseController { @@ -321,7 +325,7 @@ public class TelemetryController extends BaseController {
321 notes = "Creates or updates the device attributes based on device id, specified attribute scope, " + 325 notes = "Creates or updates the device attributes based on device id, specified attribute scope, " +
322 "and request payload that represents a JSON object with key-value format of attributes to create or update. " + 326 "and request payload that represents a JSON object with key-value format of attributes to create or update. " +
323 "For example, '{\"temperature\": 26}'. Key is a unique parameter and cannot be overwritten. Only value can " + 327 "For example, '{\"temperature\": 26}'. Key is a unique parameter and cannot be overwritten. Only value can " +
324 - "be overwritten for the key. ", 328 + "be overwritten for the key. " + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
325 produces = MediaType.APPLICATION_JSON_VALUE) 329 produces = MediaType.APPLICATION_JSON_VALUE)
326 @ApiResponses(value = { 330 @ApiResponses(value = {
327 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK + 331 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK +
@@ -344,7 +348,7 @@ public class TelemetryController extends BaseController { @@ -344,7 +348,7 @@ public class TelemetryController extends BaseController {
344 } 348 }
345 349
346 @ApiOperation(value = "Save or update attributes (saveEntityAttributesV1)", 350 @ApiOperation(value = "Save or update attributes (saveEntityAttributesV1)",
347 - notes = SAVE_ENTITY_ATTRIBUTES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 351 + notes = SAVE_ENTITY_ATTRIBUTES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
348 produces = MediaType.APPLICATION_JSON_VALUE) 352 produces = MediaType.APPLICATION_JSON_VALUE)
349 @ApiResponses(value = { 353 @ApiResponses(value = {
350 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK + SAVE_ENTITY_ATTRIBUTES_STATUS_OK), 354 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK + SAVE_ENTITY_ATTRIBUTES_STATUS_OK),
@@ -365,7 +369,7 @@ public class TelemetryController extends BaseController { @@ -365,7 +369,7 @@ public class TelemetryController extends BaseController {
365 } 369 }
366 370
367 @ApiOperation(value = "Save or update attributes (saveEntityAttributesV2)", 371 @ApiOperation(value = "Save or update attributes (saveEntityAttributesV2)",
368 - notes = SAVE_ENTITY_ATTRIBUTES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 372 + notes = SAVE_ENTITY_ATTRIBUTES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
369 produces = MediaType.APPLICATION_JSON_VALUE) 373 produces = MediaType.APPLICATION_JSON_VALUE)
370 @ApiResponses(value = { 374 @ApiResponses(value = {
371 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK + SAVE_ENTITY_ATTRIBUTES_STATUS_OK), 375 @ApiResponse(code = 200, message = SAVE_ATTIRIBUTES_STATUS_OK + SAVE_ENTITY_ATTRIBUTES_STATUS_OK),
@@ -386,7 +390,7 @@ public class TelemetryController extends BaseController { @@ -386,7 +390,7 @@ public class TelemetryController extends BaseController {
386 } 390 }
387 391
388 @ApiOperation(value = "Save or update telemetry (saveEntityTelemetry)", 392 @ApiOperation(value = "Save or update telemetry (saveEntityTelemetry)",
389 - notes = SAVE_ENTITY_TIMESERIES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 393 + notes = SAVE_ENTITY_TIMESERIES_DESCRIPTION + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
390 produces = MediaType.APPLICATION_JSON_VALUE) 394 produces = MediaType.APPLICATION_JSON_VALUE)
391 @ApiResponses(value = { 395 @ApiResponses(value = {
392 @ApiResponse(code = 200, message = SAVE_ENTITY_TIMESERIES_STATUS_OK), 396 @ApiResponse(code = 200, message = SAVE_ENTITY_TIMESERIES_STATUS_OK),
@@ -407,7 +411,8 @@ public class TelemetryController extends BaseController { @@ -407,7 +411,8 @@ public class TelemetryController extends BaseController {
407 } 411 }
408 412
409 @ApiOperation(value = "Save or update telemetry with TTL (saveEntityTelemetryWithTTL)", 413 @ApiOperation(value = "Save or update telemetry with TTL (saveEntityTelemetryWithTTL)",
410 - notes = SAVE_ENTITY_TIMESERIES_DESCRIPTION + "The ttl parameter used only in case of Cassandra DB use for timeseries data storage. " + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 414 + notes = SAVE_ENTITY_TIMESERIES_DESCRIPTION + "The ttl parameter used only in case of Cassandra DB use for timeseries data storage. "
  415 + + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
411 produces = MediaType.APPLICATION_JSON_VALUE) 416 produces = MediaType.APPLICATION_JSON_VALUE)
412 @ApiResponses(value = { 417 @ApiResponses(value = {
413 @ApiResponse(code = 200, message = SAVE_ENTITY_TIMESERIES_STATUS_OK), 418 @ApiResponse(code = 200, message = SAVE_ENTITY_TIMESERIES_STATUS_OK),
@@ -431,7 +436,7 @@ public class TelemetryController extends BaseController { @@ -431,7 +436,7 @@ public class TelemetryController extends BaseController {
431 @ApiOperation(value = "Delete entity timeseries (deleteEntityTimeseries)", 436 @ApiOperation(value = "Delete entity timeseries (deleteEntityTimeseries)",
432 notes = "Delete timeseries for selected entity based on entity id, entity type, keys " + 437 notes = "Delete timeseries for selected entity based on entity id, entity type, keys " +
433 "and removal time range. To delete all data for keys parameter 'deleteAllDataForKeys' should be set to true, " + 438 "and removal time range. To delete all data for keys parameter 'deleteAllDataForKeys' should be set to true, " +
434 - "otherwise, will be deleted data that is in range of the selected time interval. ", 439 + "otherwise, will be deleted data that is in range of the selected time interval. " + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
435 produces = MediaType.APPLICATION_JSON_VALUE) 440 produces = MediaType.APPLICATION_JSON_VALUE)
436 @ApiResponses(value = { 441 @ApiResponses(value = {
437 @ApiResponse(code = 200, message = "Timeseries for the selected keys in the request was removed. " + 442 @ApiResponse(code = 200, message = "Timeseries for the selected keys in the request was removed. " +
@@ -506,7 +511,7 @@ public class TelemetryController extends BaseController { @@ -506,7 +511,7 @@ public class TelemetryController extends BaseController {
506 511
507 @ApiOperation(value = "Delete device attributes (deleteEntityAttributes)", 512 @ApiOperation(value = "Delete device attributes (deleteEntityAttributes)",
508 notes = "Delete device attributes from the specified attributes scope based on device id and a list of keys to delete. " + 513 notes = "Delete device attributes from the specified attributes scope based on device id and a list of keys to delete. " +
509 - "Selected keys will be deleted only if there are exist in the specified attribute scope. Referencing a non-existing device Id will cause an error", 514 + "Selected keys will be deleted only if there are exist in the specified attribute scope. Referencing a non-existing device Id will cause an error" + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
510 produces = MediaType.APPLICATION_JSON_VALUE) 515 produces = MediaType.APPLICATION_JSON_VALUE)
511 @ApiResponses(value = { 516 @ApiResponses(value = {
512 @ApiResponse(code = 200, message = "Device attributes was removed for the selected keys in the request. " + 517 @ApiResponse(code = 200, message = "Device attributes was removed for the selected keys in the request. " +
@@ -529,7 +534,7 @@ public class TelemetryController extends BaseController { @@ -529,7 +534,7 @@ public class TelemetryController extends BaseController {
529 534
530 @ApiOperation(value = "Delete entity attributes (deleteEntityAttributes)", 535 @ApiOperation(value = "Delete entity attributes (deleteEntityAttributes)",
531 notes = "Delete entity attributes from the specified attributes scope based on entity id, entity type and a list of keys to delete. " + 536 notes = "Delete entity attributes from the specified attributes scope based on entity id, entity type and a list of keys to delete. " +
532 - "Selected keys will be deleted only if there are exist in the specified attribute scope." + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION, 537 + "Selected keys will be deleted only if there are exist in the specified attribute scope." + INVALID_ENTITY_ID_OR_ENTITY_TYPE_DESCRIPTION + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH,
533 produces = MediaType.APPLICATION_JSON_VALUE) 538 produces = MediaType.APPLICATION_JSON_VALUE)
534 @ApiResponses(value = { 539 @ApiResponses(value = {
535 @ApiResponse(code = 200, message = "Entity attributes was removed for the selected keys in the request. " + 540 @ApiResponse(code = 200, message = "Entity attributes was removed for the selected keys in the request. " +
@@ -302,7 +302,7 @@ public class UserController extends BaseController { @@ -302,7 +302,7 @@ public class UserController extends BaseController {
302 302
303 @ApiOperation(value = "Get Users (getUsers)", 303 @ApiOperation(value = "Get Users (getUsers)",
304 notes = "Returns a page of users owned by tenant or customer. The scope depends on authority of the user that performs the request." + 304 notes = "Returns a page of users owned by tenant or customer. The scope depends on authority of the user that performs the request." +
305 - PAGE_DATA_PARAMETERS + TENANT_OR_USER_AUTHORITY_PARAGRAPH) 305 + PAGE_DATA_PARAMETERS + TENANT_OR_CUSTOMER_AUTHORITY_PARAGRAPH)
306 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')") 306 @PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
307 @RequestMapping(value = "/users", params = {"pageSize", "page"}, method = RequestMethod.GET) 307 @RequestMapping(value = "/users", params = {"pageSize", "page"}, method = RequestMethod.GET)
308 @ResponseBody 308 @ResponseBody