                                     parent: @__root.parent()
                                 
                             return false
-        
+                        
+                        next()
+                        
         ##
         ##
         ##
         _createButton: (action, conf, fn)->
             fn null, $('<button/>').addClass action
-                  
+            
         
+        ##
+        ##
+        ##
+        _createPermitedButton: (action, conf, fn)->
+            if conf.roles
+                @identity.hasRole conf.roles, (err, hasRole)=>  
+                    return fn(err) if err || !hasRole
+                    
+                    @_createButton action, conf, fn
+            
+            else @_createButton action, conf, fn
+                    
             
            super (err)=>
                return done(err) if err
                
                @_buildButtons @__buttons
                @_wireMouse()
                
                done()
               
                
        ##

                    view: 
                        children: [ editor ]
                , fn
            
            @_process buttons,
                done: (err)=>
                    if err
                        throw err
                        
                each: (action, conf, next)=>    
                                    
                    if typeof conf is 'function'
                        conf =
                            handler: conf
                            
                    @_createPermitedButton action, conf, (err, button)=>
                        return next(err) if err || !button
                                          
                        if typeof conf is 'string'
                            conf =
                                text: conf
