Package org.exist.security

Examples of org.exist.security.Account


        if( name == null ) {
            throw( new BuildException( "You have to specify a name" ) );
        }

        try {
            final Account u = service.getAccount( name );

            if( u != null ) {
                service.removeAccount( u );
            }
View Full Code Here


        if( ( name == null ) || ( group == null ) ) {
            throw( new BuildException( "Must specify user and group" ) );
        }

        try {
            final Account usr = service.getAccount( name );

            if( resource != null ) {
                final Resource res = base.getResource( resource );
                service.chown( res, usr, group );
            } else {
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

   
  }

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

      } else {
            Collection collection = null;
        try {
                collection = new LocalCollection(contextUser, context.getBroker().getBrokerPool(), XmldbURI.ROOT_COLLECTION_URI, context.getAccessContext());
          final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
                final Account userObj = ums.getAccount(user);
                if (null != userObj)
                    {ums.removeAccount(userObj);}
        } catch (final XMLDBException xe) {
          throw new XPathException(this, "Failed to remove user " + user, xe);
            } finally {
View Full Code Here

        }
    }
   
    private IntegerValue getUMask(final DBBroker broker, final String username) {
       final SecurityManager securityManager = broker.getBrokerPool().getSecurityManager();
       final Account account = securityManager.getAccount(username);
       return new IntegerValue(account.getUserMask());
    }
View Full Code Here

        if(!currentUser.hasDbaRole() && !currentUser.getUsername().equals(username)) {
            throw new XPathException(this, new PermissionDeniedException("You must have suitable access rights to set the users umask."));
        }
       
        final SecurityManager securityManager = broker.getBrokerPool().getSecurityManager();
        final Account account = securityManager.getAccount(username);
       
        account.setUserMask(umask);
       
        try {
            securityManager.updateAccount(account);
        } catch(final PermissionDeniedException pde) {
            throw new XPathException(this, pde);
View Full Code Here

                if(!currentUser.hasDbaRole() && !currentUser.getName().equals(username)) {
                    throw new XPathException("You must be a DBA or enquiring about your own user account!");
                }

                final Account user = securityManager.getAccount(username);
                groupNames = Arrays.asList(user.getGroups());
            } else {
                throw new XPathException("Unknown function");
            }

            //order a-z
View Full Code Here

            final SecurityManager sm = context.getBroker().getBrokerPool().getSecurityManager();

            final Group group = sm.getGroup(groupName);

            final Account account = sm.getAccount(userName);
            if(account != null) {
                account.addGroup(group);
               
                //TEMP - ESCALATE TO DBA :-(
                /**
                 * Security Manager has a fundamental flaw
                 * Group Membership is stored in the Account XML: so you cannot
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.