             attachments.remove
             utils.unlockRequest
         ]
-
-    'data/:id/binaries/convert': get: [
-        utils.lockRequest
-        utils.getDoc
-        utils.checkPermissionsByDoc
-        binaries.convert
-        utils.unlockRequest
-    ]
-
-    'data/:id/binaries/': post: [
-        utils.lockRequest
-        utils.getDoc
-        utils.checkPermissionsByDoc
-        binaries.add
-        utils.unlockRequest
-    ]
+    'data/:id/binaries/convert':
+        get: [
+            utils.lockRequest
+            utils.getDoc
+            utils.checkPermissionsByDoc
+            binaries.convert
+            utils.unlockRequest
+        ]
+    'data/:id/binaries/':
+        post: [
+            utils.lockRequest
+            utils.getDoc
+            utils.checkPermissionsByDoc
+            binaries.add
+            utils.unlockRequest
+        ]
     'data/:id/binaries/:name':
-        get: [utils.getDoc, utils.checkPermissionsByDoc, binaries.get]
+        get: [
+            utils.getDoc
+            utils.checkPermissionsByDoc
+            binaries.get
+        ]
         delete: [
             utils.lockRequest
             utils.getDoc

            utils.unlockRequest
        ]

    # Scrapper connectors
    'connectors/bank/:name/': post: connectors.bank
    'connectors/bank/:name/history': post: connectors.bankHistory

    # Access management
    'access/': post: [utils.checkPermissionsFactory('access'), access.create]
    'access/:id/':
        'put': [utils.checkPermissionsFactory('access'), access.update]
        'delete': [
            utils.checkPermissionsFactory('access')
            utils.lockRequest
            utils.getDoc
            access.remove
            utils.unlockRequest
        ]

    'replication/*':
        'post': [
            utils.checkPermissionsPostReplication
            replication.proxy
        ]
        'get': [
            replication.proxy
            # Permissions manage in request
        ]
        'put':[
            utils.checkPermissionsPutReplication
            replication.proxy
        ]

    # Indexer management
    'data/index/clear-all/':
        'delete': [
            utils.checkPermissionsFactory('all')
            indexer.removeAll
        ]

    'data/index/:id':
        post: [
            utils.lockRequest
            utils.getDoc
            utils.checkPermissionsByDoc
            indexer.index
            utils.unlockRequest
        ]
        'delete': [
            utils.lockRequest
            utils.getDoc
            utils.checkPermissionsByDoc
            indexer.remove
            utils.unlockRequest
        ]
    'data/search/:type': post: [utils.checkPermissionsByType, indexer.search]
    'data/search/': post: [utils.checkPermissionsFactory('all'), indexer.search]

    # Mail management
    'mail/': post: [utils.checkPermissionsFactory('send mail'), mails.send]
    'mail/to-user': post: [
        utils.checkPermissionsFactory('send mail to user')
        mails.sendToUser
    ]
    'mail/from-user': post: [
        utils.checkPermissionsFactory('send mail from user')
        mails.sendFromUser
    ]

    #User management
    'user/': post: [utils.checkPermissionsFactory('User'), user.create]
    'user/merge/:id': put: [
        utils.lockRequest
        utils.checkPermissionsFactory('User')
        utils.getDoc
        user.merge
        utils.unlockRequest
    ]

    #Account management
    'accounts/password/':
        post: [account.checkPermissions, account.initializeKeys]
        put: [account.checkPermissions, account.updateKeys]
    'accounts/reset/': delete: [account.checkPermissions, account.resetKeys]
    'accounts/': delete: [account.checkPermissions, account.deleteKeys]

requests = require './requests'
attachments = require './attachments'
binaries = require './binaries'
indexer = require './indexer'
mails = require './mails'
user = require './user'
account = require './accounts'
access = require './access'
replication = require './replication'
sharing = require './sharing'
filters = require './filters'

utils = require '../middlewares/utils'

module.exports =

    # Information page
    '':
        get: [
            data.index
        ]


    # Data management
    'data/':
        post: [
            utils.checkPermissionsByBody
            data.encryptPassword
            data.create
        ]
    'data/search/':
        post: [
            utils.checkPermissionsFactory 'all'
            indexer.search
        ]
    'data/:id/':
        get: [
