Package org.exist.security

Examples of org.exist.security.Account


                            final SecurityManager manager = broker.getBrokerPool().getSecurityManager();
                            if(!(user.equals(u) || manager.hasAdminPrivileges(user))) {
                                throw new PermissionDeniedException("User " + user.getName() + " is not allowed to lock resource '" + resourceId + "' for user " + u.getName());
                            }

                            final Account lockOwner = document.getUserLock();

                            if(lockOwner != null) {
                                if(lockOwner.equals(u)) {
                                    return null;
                                } else if(!manager.hasAdminPrivileges(user)) {
                                    throw new PermissionDeniedException("Resource '" + resourceId + "' is already locked by user " + lockOwner.getName());
                                }
                            }

                            document.setUserLock(u);
View Full Code Here


                            if(!document.getPermissions().validate(user, Permission.WRITE)) {
        throw new PermissionDeniedException("User is not allowed to lock resource '" + resourceId + "'");
                            }
     
                           
                            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);
                           
                            return null;
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();
                    final Account account = sm.getAccount(accountName);
                    account.addGroup(groupName);
                    sm.updateAccount(account);
                   
                    return null;
                }
            });
View Full Code Here

            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;
View Full Code Here

                @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;
                }
View Full Code Here

            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;
                }
            });
View Full Code Here

        }
    }

    @Override
    public void addUser(User user) throws XMLDBException {
        final Account account = new UserAider(user.getName());
        addAccount(account);
    }
View Full Code Here

        addAccount(account);
    }

    @Override
    public void updateUser(User user) throws XMLDBException {
        final Account account = new UserAider(user.getName());
        account.setPassword(user.getPassword());
        //TODO: groups
        updateAccount(account);
    }
View Full Code Here

        // TODO Auto-generated method stub 
    }

    @Override
    public void lockResource(Resource res, User u) throws XMLDBException {
        final Account account = new UserAider(u.getName());
        lockResource(res, account);
    }
View Full Code Here

  * @param methodName The name of the method that is being invoked
  * @return A <code>RequestCtx</code> that represents the access in question.
  */
  public RequestCtx createReflectionRequest(XQueryContext context, Module contextModule, String className, String methodName)
  {
    final Account user = context.getUser();
    final Set<Subject> subjects = createQuerySubjects(user, contextModule);
    final Set<Attribute> resourceAttributes = createReflectionResource(className, methodName);
    final Set<Attribute> actionAttributes = createBasicAction(XACMLConstants.INVOKE_METHOD_ACTION);
    final Set<Attribute> environmentAttributes = createEnvironment(context.getAccessContext());

View Full Code Here

TOP

Related Classes of org.exist.security.Account

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.