Package org.exist.security

Examples of org.exist.security.SecurityManager$PrincipalIdReceiver


                            }
     
                           
                            final Account lockOwner = document.getUserLock();
     
                            final SecurityManager manager = broker.getBrokerPool().getSecurityManager();
                            if(lockOwner != null && !(lockOwner.equals(user) || manager.hasAdminPrivileges(user))) {
                                throw new PermissionDeniedException("Resource '" + resourceId + "' is already locked by user " + lockOwner.getName());
                            }
                           
                            document.setUserLock(null);
                           
View Full Code Here


        try {
            return executeWithBroker(new BrokerOperation<Account>(){

                @Override
                public Account withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    return sm.getAccount(name);
                }
            });
        } catch(final Exception e) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);
        }
View Full Code Here

        try {
            return executeWithBroker(new BrokerOperation<Account[]>(){

                @Override
                public Account[] withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    final java.util.Collection<Account> users = sm.getUsers();
                    return users.toArray(new Account[users.size()]);
                }
            });
        } catch(final Exception e) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);
View Full Code Here

        try {
            return executeWithBroker(new BrokerOperation<Group>(){

                @Override
                public Group withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    return sm.getGroup(name);
                }
            });
        } catch(final Exception e) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);
        }
View Full Code Here

        try {
            return executeWithBroker(new BrokerOperation<String[]>(){

                @Override
                public String[] withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    final java.util.Collection<Group> groups = sm.getGroups();
                    final String[] groupNames = new String[groups.size()];
                    int i = 0;
                    for (final Group group : groups) {
                        groupNames[i++] = group.getName();
                    }
View Full Code Here

        try {
            executeWithBroker(new BrokerOperation<Void>(){

                @Override
                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

    public void removeGroup(final Group group) throws XMLDBException {
        try {
            executeWithBroker(new BrokerOperation<Void>(){
                @Override
                public Void withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
         
                    sm.deleteGroup(group.getName());
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

        try {
            executeWithBroker(new BrokerOperation<Void>(){

                @Override
                public Void withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
         
                    sm.updateAccount(u);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

        try {
            executeWithBroker(new BrokerOperation<Void>(){

                @Override
                public Void withBroker(final DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
         
                    sm.updateGroup(g);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

    public String[] getGroupMembers(final String groupName) throws XMLDBException {
        try {
            final List<String> groupMembers = executeWithBroker(new BrokerOperation<List<String>>(){
                @Override
                public List<String> withBroker(final DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                   
                    return sm.findAllGroupMembers(groupName);
                }
            });
           
            return groupMembers.toArray(new String[groupMembers.size()]);
        } catch(final Exception e) {
View Full Code Here

TOP

Related Classes of org.exist.security.SecurityManager$PrincipalIdReceiver

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.