Saves the permission.<p>
424021
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);
        }
    }
9866
public void addPermission(Permission permission) {
        if ((securityManager != null) && (permission != null)) {
            permissionList.add(permission);
        }
    }
565951
protected void doSave() {

        List<CmsFavoriteEntry> entries = getEntries();
        try {
            m_favDao.saveFavorites(entries);
        } catch (Exception e) {
            CmsErrorDialog.showErrorDialog(e);
        }
    }
1343192
public void saveRecentList(CmsObject cms, List<CmsContainerElementBean> recentList) throws CmsException {

        saveElementList(cms, recentList, ADDINFO_ADE_RECENT_LIST);
    }
642717
@RequestMapping(value = "globals/{type}/{id}", method = RequestMethod.PUT)
    public Ack saveGlobalPermission(@PathVariable PermissionTargetType type, @PathVariable int id, @RequestBody PermissionInput input) {
        return accountService.saveGlobalPermission(type, id, input);
    }
1336158
@Override
	public synchronized void setPermissions(Collection<Permission> aPermissions)
	{
		this.permissions.clear();
		if (aPermissions == null || aPermissions.isEmpty())
			return;

		List<Permission> set =new ArrayList<Permission>(aPermissions);

		this.permissions = set;

	}
1046475
void saveAndExit() {

        boolean unlock = shouldUnlockAutomatically();
        // store the scroll position
        final int scrollTop = RootPanel.getBodyElement().getOwnerDocument().getScrollTop();
        saveAndDeleteEntities(unlock, new I_CmsSimpleCallback<Boolean>() {

            public void execute(final Boolean hasChangedSettings) {

                setSaved();
                if (m_onClose != null) {
                    m_onClose.execute(Boolean.valueOf(m_hasChangedSettings || hasChangedSettings.booleanValue()));
                }
                clearEditor();
                // restore the scroll position
                RootPanel.getBodyElement().getOwnerDocument().setScrollTop(scrollTop);
            }
        });
    }
1203540
void editUserData() {

        if (m_context instanceof CmsEmbeddedDialogContext) {
            ((CmsEmbeddedDialogContext)m_context).closeWindow(true);
        } else {
            A_CmsUI.get().closeWindows();
        }
        CmsUserDataDialog dialog = new CmsUserDataDialog(m_context);
        m_context.start(CmsVaadinUtils.getMessageText(Messages.GUI_USER_EDIT_0), dialog);
    }
857892
protected synchronized void unsetPermission(ServiceReference<JavaPermissionsConfiguration> permission) {
        permissions.removeReference(permission);
        if (wsjarUrlStreamHandlerAvailable) {
            clearPermissions();
            initializePermissions();
        }
    }
1240182
@Override
    public synchronized void save() {
        if(areStatsDisabled()){
            return;
        }
        
        if (BulkChange.contains(this))
            return;
        
        /*
         * Note: the userFolder should never be null at this point.
         * The userFolder could be null during User creation with the new storage approach
         * but when this code is called, from token used / removed, the folder exists.
         */
        File userFolder = getUserFolder();
        if (userFolder == null) {
            return;
        }
        
        XmlFile configFile = getConfigFile(userFolder);
        try {
            configFile.write(this);
            SaveableListener.fireOnChange(this, configFile);
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to save " + configFile, e);
        }
    }
590160
public void setAcePermissionsDenied(String acePermissionsDenied) {

        try {
            m_acePermissionsDenied = Integer.parseInt(acePermissionsDenied);
        } catch (Throwable e) {
            m_throwable = e;
        }
    }
337897
protected void submit() {

        if (m_userinfoNoEditGroup.getRows().size() != m_addInfoReadOnly.size()) {
            List<String> currentKeys = getKeyListFromGroup(m_userinfoNoEditGroup);
            for (String key : m_addInfoReadOnly.keySet()) {
                if (!currentKeys.contains(key)) {
                    saveAddInfo(key, null);
                }
            }
        }

        for (I_CmsEditableGroupRow row : m_userinfoGroup.getRows()) {
            String key = ((TextField)(((HorizontalLayout)row.getComponent()).getComponent(0))).getValue();
            String value = ((TextField)(((HorizontalLayout)row.getComponent()).getComponent(1))).getValue();
            saveAddInfo(key, value);
            m_addInfoEditable.remove(key);
        }

        //Remaining items in list seem to be deleted by the user..
        for (String key : m_addInfoEditable.keySet()) {
            saveAddInfo(key, null);
        }
        try {
            m_cms.writeUser(m_user);
        } catch (CmsException e) {
            LOG.error("Unable to write user.", e);
        }
    }
724994
@Override
    public CmsFile writeFile(CmsObject cms, CmsSecurityManager securityManager, CmsFile resource) throws CmsException {

        String savingStr = (String)cms.getRequestContext().getAttribute(CmsContentService.ATTR_EDITOR_SAVING);
        CmsFile file = super.writeFile(cms, securityManager, resource);
        // Formatter configuration cache updates are asynchronous, but to be able to reload a container page
        // element in the page editor directly after editing it and having it reflect the changes made by the user
        // requires that we wait on a wait handle for the formatter cache.

        if (Boolean.valueOf(savingStr).booleanValue()) {
            CmsWaitHandle waitHandle = OpenCms.getADEManager().addFormatterCacheWaitHandle(false);
            waitHandle.enter(10000);
        }
        return file;
    }
1313246
def add_permission(self, perm):
        
        self.Permissions(permission=perm)
        PermissionCache.flush()
        self.save()
310775
public void updateAndSave(List<CmsDetailPageInfo> infos, CmsUUID newId) throws CmsException {

        if (m_resource != null) {
            getDocument();
            removeOldValues();
            writeDetailPageInfos(infos, newId);
            m_document.setAutoCorrectionEnabled(true);
            m_document.correctXmlStructure(m_cms);
            byte[] content = m_document.marshal();
            m_file.setContents(content);
            m_cms.writeFile(m_file);
        }
    }
427893
private void save() {
    Preferences pref = Preferences
        .userNodeForPackage(ConnectionDialog.class);

    pref.put("host", getHost());
    pref.put("user", getUser());

    boolean remember = getRememberPasswordCheckBox().isSelected();
    if (remember) {
      try {
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
        KeyGenerator keygen = KeyGenerator.getInstance("AES");
        SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
        random.setSeed(new byte[]{
          0x60, (byte) 0xFD, 0x28, 0x07, 0x35, 0x4A, 0x0D, 0x3B
        });
        byte[] iv = new byte[16];
        random.nextBytes(iv);
        IvParameterSpec spec = new IvParameterSpec(iv);
        keygen.init(128, random);
        cipher.init(Cipher.ENCRYPT_MODE, keygen.generateKey(), spec);
        byte[] clearText = getPassword().getBytes();
        byte[] cipherText = cipher.doFinal(clearText);
        pref.putByteArray("password", cipherText);
        pref.putBoolean("remember", true);
      } catch (Exception e) {
        logger.error("Could not encrypt password", e);
        pref.remove("password");
        pref.putBoolean("remember", false);
      }
    } else {
      pref.remove("password");
      pref.putBoolean("remember", false);
    }
  }
1271724
private CmsPushButton saveButton() {

        CmsPushButton button = new CmsPushButton();
        button.setText(Messages.get().key(Messages.GUI_SAVE_0));
        button.setUseMinWidth(true);
        button.addClickHandler(new ClickHandler() {

            /**
             * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
             */
            public void onClick(ClickEvent event) {

                CmsSeoOptionsDialog.this.onClickSave();
            }
        });
        return button;
    }