mm.put("individual",Integer.toString(PermissionAPI.PERMISSION_READ | PermissionAPI.PERMISSION_WRITE | PermissionAPI.PERMISSION_CAN_ADD_CHILDREN));
mm.put("structures", Integer.toString(PermissionAPI.PERMISSION_READ | PermissionAPI.PERMISSION_WRITE | PermissionAPI.PERMISSION_PUBLISH));
mm.put("content", Integer.toString(PermissionAPI.PERMISSION_READ | PermissionAPI.PERMISSION_WRITE | PermissionAPI.PERMISSION_PUBLISH));
mm.put("pages", Integer.toString(PermissionAPI.PERMISSION_READ | PermissionAPI.PERMISSION_WRITE | PermissionAPI.PERMISSION_PUBLISH));
mm.put("folders", Integer.toString(PermissionAPI.PERMISSION_READ | PermissionAPI.PERMISSION_WRITE | PermissionAPI.PERMISSION_CAN_ADD_CHILDREN));
new RoleAjax().saveRolePermission(nrole1.getId(), a.getInode(), mm, false);
cont1=new Contentlet();
cont1.setStructureInode(s.getInode());
cont1.setStringProperty("testtext", "a test value");
cont1=APILocator.getContentletAPI().checkin(cont1, sysuser, false);
APILocator.getContentletAPI().isInodeIndexed(cont1.getInode());
perm.getPermissions(cont1); // to cache
new RoleAjax().saveRolePermission(nrole2.getId(), a.getInode(), mm, false);
boolean found1=false,found2=false;
for(Permission p : perm.getPermissions(cont1)) {
found1 = found1 || p.getRoleId().equals(nrole1.getId());
found2 = found2 || p.getRoleId().equals(nrole2.getId());