public void save() { // The static config can't be updated, so delegate to xml file manager.save(); }
private void saveConfiguration() { this.configuration.save(); }
@Override public void run() throws Exception { configuration.createPrivilege( secPriv ); configuration.save(); } });
@Override public void run() throws Exception { configuration.deleteRole( roleId ); configuration.save(); } });
@Override public void run() throws Exception { configuration.updatePrivilege( secPriv ); configuration.save(); } });
@Override public void run() throws Exception { configuration.updateRole( secRole ); configuration.save(); } });
@Override public void save() { checkWriteLock(); configurationManager.save(); }
@Override public void run() throws Exception { configuration.createRole( secRole ); configuration.save(); } });
@Override public void run() throws Exception { configuration.deletePrivilege( privilegeId ); configuration.save(); } });
@Override public void run() throws Exception { try { user.setPassword(passwordService.encryptPassword(password)); configuration.updateUser(user); configuration.save(); } catch(Exception e) { //Update failed, rollback to previous values user.setPassword(currentPasswordHash); logger.error("Unable to update hash for user {}", user.getId()); } } });
protected void cleanupPrivileges( String propertyId, String propertyValue ) throws NoSuchPrivilegeException, NoSuchAuthorizationManagerException { Set<Privilege> privileges = security.listPrivileges(); Set<String> removedIds = new HashSet<String>(); for ( Privilege privilege : privileges ) { if ( !privilege.isReadOnly() && privilege.getType().equals( TargetPrivilegeDescriptor.TYPE ) && ( propertyValue.equals( privilege.getPrivilegeProperty( propertyId ) ) ) ) { getLogger().debug( "Removing Privilege " + privilege.getName() + " because repository was removed" ); security.getAuthorizationManager( SecurityXmlAuthorizationManager.SOURCE ).deletePrivilege( privilege.getId() ); removedIds.add( privilege.getId() ); } } for ( String privilegeId : removedIds ) { configManager.cleanRemovedPrivilege( privilegeId ); } configManager.save(); } }