Github user GERey commented on a diff in the pull request:
https://github.com/apache/usergrid/pull/488#discussion_r55393687
--- Diff:
stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java
---
@@ -482,20 +482,27 @@ public ApiResponse executePut( @Context UriInfo ui,
String body,
@Produces({MediaType.APPLICATION_JSON, "application/javascript"})
public ApiResponse executeDelete( @Context UriInfo ui,
@QueryParam("callback") @DefaultValue("callback") String callback,
- @QueryParam("app_delete_confirm") String confirmDelete) throws
Exception {
+ @QueryParam("application_identifier") String
applicationConfirmedDelete) throws Exception {
- if (!"confirm_delete_of_application_and_data".equals(
confirmDelete ) ) {
+ //If the path uses name then expect name, otherwise if they use
uuid then expect uuid.
+ if(application==null){
+ if(!applicationId.toString().equals(
applicationConfirmedDelete )){
+ throw new IllegalArgumentException(
+ "Cannot delete application without supplying correct
application id.");
+ }
+ }
+ else if (!application.getName().equals( applicationConfirmedDelete
) ) {
throw new IllegalArgumentException(
- "Cannot delete application without app_delete_confirm
parameter");
+ "Cannot delete application without supplying correct
application name");
}
- Properties props = management.getProperties();
-
- // for now, only works in test mode
- String testProp = ( String ) props.get( "usergrid.test" );
- if ( testProp == null || !Boolean.parseBoolean( testProp ) ) {
- throw new UnsupportedRestOperationException("Test props not
not functioning correctly.");
- }
+// Properties props = management.getProperties();
+//
--- End diff --
This one was my bad. The commented out code should be good.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---