Package org.exist.security

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


                @Override
                public Void withBroker(final DBBroker broker) throws EXistException, URISyntaxException, PermissionDeniedException {
                    final Account account = manager.getAccount(username);
                    final Group group = manager.getGroup(groupName);
                    account.setPrimaryGroup(group);
                    manager.updateAccount(account);
                    return null;
                }
            });
            return true;
        } catch (final URISyntaxException use) {
View Full Code Here


                @Override
                public Void withBroker(final DBBroker broker) throws EXistException, PermissionDeniedException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                    final Account account = sm.getAccount(accountName);
                    account.addGroup(groupName);
                    sm.updateAccount(account);
                   
                    return null;
                }
            });
        } catch (final URISyntaxException use) {
View Full Code Here

                public Void withBroker(final DBBroker broker) throws EXistException, PermissionDeniedException {
                    final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
                   
                    final Account account = sm.getAccount(member);
                    account.remGroup(group);
                    sm.updateAccount(account);
                   
                    return null;
                }
            });
        } catch (final URISyntaxException use) {
View Full Code Here

            if (!u.hasGroup(g)) {
              u.addGroup(g);
            }
          }

          return manager.updateAccount(u);
         
        } catch (final Exception ex) {
          LOG.debug("addUserGroup encountered error", ex);
          return false;
        } finally {
View Full Code Here

          if (g.equals(rgroup)) {
            u.remGroup(g);
          }
        }
       
        return manager.updateAccount(u);

      } catch (final Exception ex) {
        LOG.debug("removeGroup encountered error", ex);
        return false;
      } finally {
View Full Code Here

        final SecurityManager manager = factory.getBrokerPool().getSecurityManager();
        try {
            return executeWithBroker(new BrokerOperation<Boolean>() {
                @Override
                public Boolean withBroker(final DBBroker broker) throws EXistException, URISyntaxException, PermissionDeniedException {
                    return manager.updateAccount(account);
                }
            });
        } catch (final URISyntaxException use) {
            throw new EXistException(use.getMessage(), use);
        }
View Full Code Here

                context.getBroker().setSubject(sm.getSystemSubject());

                //perform action
                for(final Account manager : group.getManagers()) {
                    manager.addGroup(group);
                    sm.updateAccount(manager);
                }
            } finally {
                context.getBroker().setSubject(currentSubject);
            }
            //END TEMP
View Full Code Here

        final Account account = securityManager.getAccount(username);
       
        account.setUserMask(umask);
       
        try {
            securityManager.updateAccount(account);
        } catch(final PermissionDeniedException pde) {
            throw new XPathException(this, pde);
        } catch(final EXistException ee) {
            throw new XPathException(this, ee);
        }
View Full Code Here

                        throw new XPathException("You may only change your own password, unless you are a DBA.");
                    }

                    final Account account = securityManager.getAccount(username);
                    account.setPassword(password);
                    securityManager.updateAccount(account);

                } else if(isCalledAs(qnCreateAccount.getLocalName())) {
                    /* create account */
                    if(!currentUser.hasDbaRole()) {
                        throw new XPathException("You must be a DBA to create a User Account.");
View Full Code Here

                final Account account = securityManager.getAccount(username);

                //set the primary group
                account.setPrimaryGroup(group);
                securityManager.updateAccount(account);

            } else {

                final String groupName = args[0].getStringValue();
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.