         if body.permissions?
             for docType, description of body.permissions
                 permissions[name][docType.toLowerCase()] = description
-        callback()
+        callback() if callback?
 
 
 ## function initHomeProxy (callback)

## Update device permissions and token
## TODOS : Assimilate devices and applications
module.exports.updateDevicePermissions = (body, callback) ->
    console.log 'updateDevicePermissions'
    name = body.login
    if productionOrTest
        if body.password?

        if body.permissions?
            for docType, description of body.permissions
                permissions[name][docType.toLowerCase()] = description
        callback() if callback?

## function updatePermissons (body, callback)
## @body {Object} application:
