Package org.exist.security

Examples of org.exist.security.SecurityManager


    public void addAccountToGroup(final String accountName, final String groupName) throws XMLDBException {
        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();
                    final Account account = sm.getAccount(accountName);
                    account.addGroup(groupName);
                    sm.updateAccount(account);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here


    public void addGroupManager(final String manager, final String groupName) throws XMLDBException {
        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();
                   
                    final Account account = sm.getAccount(manager);
                    final Group group = sm.getGroup(groupName);
                    group.addManager(account);
                    sm.updateGroup(group);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

    public void removeGroupManager(final String groupName, final String manager) throws XMLDBException {
        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();
                   
                    final Group group = sm.getGroup(groupName);
                    final Account account = sm.getAccount(manager);
                    group.removeManager(account);
                    sm.updateGroup(group);
                   
                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

    public void removeGroupMember(final String group, final String member) throws XMLDBException {
        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();
                   
                    final Account account = sm.getAccount(member);
                    account.remGroup(group);
                    sm.updateAccount(account);

                    return null;
                }
            });
        } catch(final Exception e) {
View Full Code Here

        final Txn transaction = transact.beginTransaction();
       
        DocumentImpl document = null;
        try {
            document = ((AbstractEXistResource) resource).openDocument(broker, Lock.WRITE_LOCK);
            final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
            if(!document.getPermissions().validate(user, Permission.WRITE) && !sm.hasAdminPrivileges(user)) {
                throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, "you are not the owner of this resource; owner = " + document.getPermissions().getOwner());
            }
           
            final R result = modifier.modify(document);
           
View Full Code Here

     */
    public Account getUserLock() {
        final int lockOwnerId = getMetadata().getUserLock();
        if(lockOwnerId == 0)
            {return null;}
        final SecurityManager secman = pool.getSecurityManager();
        return secman.getAccount(lockOwnerId);
    }
View Full Code Here

TOP

Related Classes of org.exist.security.SecurityManager

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.