anchor.diff:        }
       }
     });
  +  $(".permissions_field").each(function(){
  +    var permissionsField = $(this)
  +    permissionsField.data("toString", function(){
  +      var permissions = []
  +      permissionsField.find("input").each(function(){
  +        permissions.push($(this).is(":checked"));
  +      });
  +      return permissions.toString();
  +    });
  +  });
  +  $(".permissions_field").each(function(){
  +    var permissionsField = $(this)
  +    permissionsField.data("fromString", function(values){      
  +      var permissions = values.split(",");
  +      for(var i in permissions){
  +        permissions[i] = (permissions[i] === "true");
  +        permissionsField.find("input").eq(i).attr('checked', permissions[i]);
  +      }
  +      console.log(permissions);
  +    });
  +  });
  +  
   <% end %>
  
positive.code:           var index = i;
            var recentlyCreated = (newIndex != -1)&&(newIndex == index);
            if(subsector){
              if(!noAdding && (recentlyCreated || ((newIndex == -1)&&(i == 0)))){
                if(!$("#subsector_" + i).find(".content").is(':visible')){
                  var time = 1000;
  
negative.code:             }
              $("#subsector_" + i).stop().show();
              if(!maxReached){
                if(sector.subsectors[i+1]==undefined){
                  $("#add_subsector_" + (i+1)).off("click");
                  if(!$("#add_subsector_" + (i+1)).is(':visible')){
  