Package org.exist.security.internal.aider

Examples of org.exist.security.internal.aider.UserAider.addGroup()


            //AccountImpl actAdmin = new AccountImpl(broker, this, ADMIN_ACCOUNT_ID, SecurityManager.DBA_USER, "", GROUP_DBA, true);
            final UserAider actAdmin = new UserAider(ADMIN_ACCOUNT_ID, getId(), SecurityManager.DBA_USER);
            actAdmin.setPassword(DEFAULT_ADMIN_PASSWORD);
            actAdmin.setMetadataValue(AXSchemaType.FULLNAME, SecurityManager.DBA_USER);
            actAdmin.setMetadataValue(EXistSchemaType.DESCRIPTION, "System Administrator");
            actAdmin.addGroup(SecurityManager.DBA_GROUP);
            getSecurityManager().addAccount(broker, actAdmin);
        }

        //Guest account
        if(getSecurityManager().getAccount(GUEST_ACCOUNT_ID) == null) {
View Full Code Here


            //AccountImpl actGuest = new AccountImpl(broker, this, GUEST_ACCOUNT_ID, SecurityManager.GUEST_USER, SecurityManager.GUEST_USER, GROUP_GUEST, false);
            final UserAider actGuest = new UserAider(GUEST_ACCOUNT_ID, getId(), SecurityManager.GUEST_USER);
            actGuest.setMetadataValue(AXSchemaType.FULLNAME, SecurityManager.GUEST_USER);
            actGuest.setMetadataValue(EXistSchemaType.DESCRIPTION, "Anonymous User");
            actGuest.setPassword(DEFAULT_GUEST_PASSWORD);
            actGuest.addGroup(SecurityManager.GUEST_GROUP);
            getSecurityManager().addAccount(broker, actGuest);
        }
    }
   
    @Override
View Full Code Here

    final NodeList gl = node.getChildNodes();
    Node group;
    for (int i = 0; i < gl.getLength(); i++) {
      group = gl.item(i);
      if (group.getNodeType() == Node.ELEMENT_NODE && group.getLocalName().equals(GROUP))
        {new_account.addGroup(group.getFirstChild().getNodeValue());}
    }
   
    return new_account;
  }
 
View Full Code Here

        userAider.setEnabled(!cbDisabled.isSelected());
        userAider.setUserMask(UmaskSpinnerModel.octalUmaskToInt((String)spnUmask.getValue()));
       
        //add the personal group to the user
        if(cbPersonalGroup.isSelected()) {
            userAider.addGroup(txtUsername.getText());
        }
       
        //add any other groups to the user
        final Iterator<String> itMemberOfGroups = memberOfGroupsModel.iterator();
        while(itMemberOfGroups.hasNext()) {
View Full Code Here

       
        //add any other groups to the user
        final Iterator<String> itMemberOfGroups = memberOfGroupsModel.iterator();
        while(itMemberOfGroups.hasNext()) {
            final String memberOfGroup = itMemberOfGroups.next();
            userAider.addGroup(memberOfGroup);
        }
       
        //set the primary group
        try {
            userAider.setPrimaryGroup(new GroupAider(getPrimaryGroup()));
View Full Code Here

                    final String groups = console.readLine("enter groups: ");
                    final StringTokenizer tok = new StringTokenizer(groups, " ,");
                    while (tok.hasMoreTokens()) {
                        final String group = tok.nextToken();
                        if (group.length() > 0) {
                            user.addGroup(group);
                        }
                    }
                   
                    mgtService.addAccount(user);
                    System.out.println("user " + user + " created.");
View Full Code Here

            }
            if (user != null && !secman.hasAccount(user)) {
                final UserAider aider = new UserAider(user);
                aider.setPassword(password);
                if (group != null)
                    {aider.addGroup(group);}

                secman.addAccount(aider);
            }
        } catch (final ConfigurationException e) {
            throw new PackageException("Failed to create user: " + user, e);
View Full Code Here

            if( secret != null ) {
                usr.setPassword( secret );
            }

            if( primaryGroup != null ) {
                usr.addGroup( primaryGroup );
            }

            log( "Adding user " + name, Project.MSG_INFO );
            service.addAccount( usr );
View Full Code Here

                    //create the user account
                    final UserAider userAider = new UserAider(ID, username, primaryGroup);

                    //add the member groups
                    for(final Group memberOf_group : getGroupMembershipForLdapUser(ctx, ldapUser)) {
                        userAider.addGroup(memberOf_group);
                    }

                    //store any requested metadata
                    for(final SimpleEntry<AXSchemaType, String> metadata : getMetadataForLdapUser(ldapUser)) {
                        userAider.setMetadataValue(metadata.getKey(), metadata.getValue());
View Full Code Here

        group.setMetadataValue(EXistSchemaType.DESCRIPTION, "Personal group for " + username);
        group.addManager(ums.getAccount("admin"));
        ums.addGroup(group);

        //add the personal group as the primary group
        user.addGroup(username);

        //create the account
        ums.addAccount(user);

        //add the new account as a manager of their personal group
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.