code: void savePermissions() {
  
          try {
              ensureLock();
              for (CmsPermissionBean bean : m_permissionToChange) {
                  if (bean.isDeleted()) {
                      m_cms.rmacc(m_cms.getSitePath(m_resource), bean.getPrincipalType(), bean.getPrincipalName());
  
                  } else {
                      if (bean.getPermissionString() == null) {
                          m_cms.chacc(
                              m_cms.getSitePath(m_resource),
                              bean.getPrincipalType(),
                              bean.getPrincipalName(),
                              bean.getAllowed(),
                              bean.getDenied(),
                              bean.getFlags());
                      } else {
                          m_cms.chacc(
                              m_cms.getSitePath(m_resource),
                              bean.getPrincipalType(),
                              bean.getPrincipalName(),
                              bean.getPermissionString());
                      }
                  }
              }
          } catch (CmsException e) {
              m_context.error(e);
          }
      }
docs: Saves the permission.<p>