fix(fiat): only sync users if there are any roles to process
@@ -26,11 +26,7 @@ import groovy.util.logging.Slf4j
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
-import org.springframework.web.bind.annotation.PathVariable
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-import org.springframework.web.bind.annotation.RestController
+import org.springframework.web.bind.annotation.*
import retrofit.RetrofitError
@Slf4j
@@ -124,6 +120,7 @@ public class PermissionsController {
roles += oldPermission.permissions.allGroups()
}
+ if (!roles.isEmpty()) {
try {
fiatService.sync(roles as List)
} catch (RetrofitError re) {
@@ -131,3 +128,4 @@ public class PermissionsController {
}
}
}
+}
