                             
                             done? err
             
+            ##
+            ##
             if manager = config.data.authManager
                 
                 if config.ORIGIN

                    
                    new floyd.auth.Handler

                        #
                        authorize: (token, fn)=>
                            
                            #console.log 'autorizazion request', __user, @id
                            
                            if !@identity
                                #console.log 'no identity', __user?.login
                                
                                fn null, __user

                            else
                                #console.log 'using manager for authorize'
                                _auth (err, auth)=>
                                    return fn(err) if err

                                    #console.log 'delegate authorize', @identity.id
                                    auth.authorize token, (err, user)=>
                                            
                                        fn err, __user = user
                            
                        ##
                        authenticate: (identity, fn)=>
                            #console.log 'using manager for authenticate', identity.id
                            
                            _auth (err, auth)=>
                                if err || !auth
                                    @logger.warning 'authentication failed!\n\terror: %s\n\tfor: %s', \
                                        (err?.message ? 'noauth'), identity.id
                                    
                                    fn (err ? new Error 'authentication failed!')
                            
                                else
                                    @logger.debug 'delegate authenticate to: %s for: %s', auth.ID, identity.id
                                    auth.authenticate identity, fn
            
                        ##
                        login: (token, user, pass, fn)=>
                            #console.log 'using manager for login', user
                            
                            _auth (err, auth)=>
                                return fn(err) if err
                                
                                #console.log 'delegate login', token
                            
                                auth.login token, user, pass, (err)=>
                                    
                                    #console.log 'login granted', _user, @id
                                    
                                    fn err
                            
                            
                        ##
                        logout: (token, fn)=>
                                
                            #console.log 'using manager for logout'
                            _auth (err, auth)=>
                                return fn(err) if err
                                
                                #console.log 'delegate logout', token
                                auth.logout  token, (err)=>

                                    __user = null
                                
                                    fn? err
                        
                ##
                if config.TOKEN
                    @_getAuthManager().authorize config.TOKEN

                    
            if typeof config?.configure is 'function'
                config = config.configure.apply @, [config]

        init: (config={}, done)->         
            
            config = @configure config
            
            @id = config.id
                    
            @ID = if !(@parent?.ID) then @id else @parent.ID+'.'+@id
            
            @data = new floyd.data.SearchableMap config.data, @parent?.data
            
            if typeof (@type = config.type) is 'function'
                @type = @ID+'.'+(@type.name || 'DynContext')
            
            @identity = @_createIdentity()
            
            @logger = @_createLogger @ID
            
            @_emitter = @_createEmitter config
            
            # --> EXPERIMENTAL identity based lookups cache -> nero
            
            if config.USELOOKUPSCACHE
                USELOOKUPSCACHE = true
                @logger.debug 'init lookups cache'
            
            # <-- EXPERIMENTAL 
            
            @children = new floyd.data.MappedCollection()

