Package org.exist.security

Examples of org.exist.security.AbstractPrincipal


       
        groupsByName.modify2E(new PrincipalDbModify2E<Group, PermissionDeniedException, EXistException>(){
            @Override
            public void execute(Map<String, Group> principalDb) throws PermissionDeniedException, EXistException {
       
              final AbstractPrincipal remove_group = (AbstractPrincipal)principalDb.get(group.getName());
              if(remove_group == null)
                    {throw new IllegalArgumentException("Group does '"+group.getName()+"' not exist!");}
   
              final DBBroker broker = getDatabase().getActiveBroker();
                final Subject subject = broker.getSubject();
               
                ((Group)remove_group).assertCanModifyGroup(subject);
   
                remove_group.setRemoved(true);
                remove_group.setCollection(broker, collectionRemovedGroups, XmldbURI.create(UUIDGenerator.getUUID() + ".xml"));
   
                final TransactionManager transaction = getDatabase().getTransactionManager();
                Txn txn = null;
                try {
                    txn = transaction.beginTransaction();

                    collectionGroups.removeXMLResource(txn, broker, XmldbURI.create(remove_group.getName() + ".xml" ));

                    transaction.commit(txn);
                } catch (final Exception e) {
                    transaction.abort(txn);
                    LOG.debug(e);
                } finally {
                    transaction.close(txn);
                }

                getSecurityManager().addGroup(remove_group.getId(), (Group)remove_group);
                principalDb.remove(remove_group.getName());
            }
        });
       
        return true;
    }
View Full Code Here

TOP

Related Classes of org.exist.security.AbstractPrincipal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.