Package org.exist.security

Examples of org.exist.security.SecurityManager.deleteAccount()


       
        try {
            executeWithBroker(new BrokerOperation<Void>() {
                @Override
                public Void withBroker(final DBBroker broker) throws EXistException, URISyntaxException, PermissionDeniedException {
                    manager.deleteAccount(name);
                    return null;
                }
            });
        } catch (final URISyntaxException use) {
            throw new EXistException(use.getMessage(), use);
View Full Code Here


                if(currentUser.getName().equals(username)) {
                    throw new XPathException("You cannot remove yourself i.e. the currently logged in user.");
                }

                securityManager.deleteAccount(username);

            } else {

                final String password = args[1].getStringValue();
View Full Code Here

                public Void withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    if(!sm.hasAdminPrivileges(user))
                      {throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, "you are not allowed to remove users");}
         
                    sm.deleteAccount(u);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.