Package org.dspace.eperson

Examples of org.dspace.eperson.Group


        Community c = new Community(context, row);
        c.handle = HandleManager.createHandle(context, c);

        // create the default authorization policy for communities
        // of 'anonymous' READ
        Group anonymousGroup = Group.find(context, 0);

        ResourcePolicy myPolicy = ResourcePolicy.create(context);
        myPolicy.setResource(c);
        myPolicy.setAction(Constants.READ);
        myPolicy.setGroup(anonymousGroup);
View Full Code Here


       
        // Delete community row
        DatabaseManager.delete(ourContext, communityRow);

        // Remove administrators group - must happen after deleting community
        Group g = getAdministrators();

        if (g != null)
        {
            g.delete();
        }
    }
View Full Code Here

            for (String groupName : groupNames)
            {
                if (groupName != null)
                {
                    Group group = Group.findByName(context, groupName);
                    if (group != null)
                    {
                        groupIDs.add(new Integer(group.getID()));
                    }
                    else
                    {
                        log.warn(LogManager.getHeader(context,
                                "configuration_error", "unknown_group="
View Full Code Here

 
  public void addBody(Body body) throws WingException, SQLException, AuthorizeException
  {
    String role = parameters.getParameter("role", null);
    int groupID = parameters.getParameterAsInteger("groupID", -1);
    Group toBeDeleted = Group.find(context, groupID);
   
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-role-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection");
      main.setHead(T_main_head.parameterize(role));
      // Different help message for the default read group to enforce its non-retroactive nature
      if (role == "DEFAULT_READ")
        main.addPara(T_main_para_read.parameterize(toBeDeleted.getName()));
      else
        main.addPara(T_main_para.parameterize(toBeDeleted.getName()));
     
      Para buttonList = main.addPara();
      buttonList.addButton("submit_confirm").setValue(T_submit_confirm);
      buttonList.addButton("submit_cancel").setValue(T_submit_cancel);
           
View Full Code Here

      if (!context.getCurrentUser().getNetid().equals(""))
      {
        String groupName = ConfigurationManager.getProperty("ldap.login.specialgroup");
        if ((groupName != null) && (!groupName.trim().equals("")))
        {
        Group ldapGroup = Group.findByName(context, groupName);
          if (ldapGroup == null)
          {
            // Oops - the group isn't there.
            log.warn(LogManager.getHeader(context,
                "ldap_specialgroup",
                "Group defined in ldap.login.specialgroup does not exist"));
            return new int[0];
          } else
          {
            return new int[] { ldapGroup.getID() };
          }
        }
      }
    }
    catch (Exception npe) {
View Full Code Here

    public static void remove(Context context, int wsItemID, int groupID)
        throws SQLException, AuthorizeException
    {
        // get the workspace item and the group from the request values
        WorkspaceItem wsItem = WorkspaceItem.find(context, wsItemID);
        Group group = Group.find(context, groupID);
       
        // remove the link from the supervisory database
        String query = "DELETE FROM epersongroup2workspaceitem " +
                       "WHERE workspace_item_id = ? "+
                       "AND eperson_group_id = ? ";
View Full Code Here

        // the DSpace API for doing so
        if (policy != POLICY_NONE)
        {
            WorkspaceItem wsItem = WorkspaceItem.find(context, wsItemID);
            Item item = wsItem.getItem();
            Group group = Group.find(context, groupID);
           
            // "Editor" implies READ, WRITE, ADD permissions
            // "Observer" implies READ permissions
            if (policy == POLICY_EDITOR)
            {
View Full Code Here

      // Of course we aren't an administrator yet so we need to
      // circumvent authorisation
      context.setIgnoreAuthorization(true);
     
      // Find administrator group
      Group admins = Group.find(context, 1);
     
      if (admins == null)
      {
        throw new Exception("Error, no admin group (group 1) found");
      }
     
      // Create the administrator e-person
        EPerson eperson = EPerson.findByEmail(context,email);
       
        // check if the email belongs to a registered user,
        // if not create a new user with this email
        if (eperson == null)
        {
            eperson = EPerson.create(context);
            eperson.setEmail(email);
            eperson.setCanLogIn(true);
            eperson.setRequireCertificate(false);
            eperson.setSelfRegistered(false);
        }
     
      eperson.setLastName(last);
      eperson.setFirstName(first);
      eperson.setLanguage(language);
      eperson.setPassword(pw);
      eperson.update();
     
      admins.addMember(eperson);
      admins.update();
     
      context.complete();
     
      System.out.println("Administrator account created");
    }
View Full Code Here

           
            Item item = member.addItem();
            item.addXref(url,group.getName());
           
            // Check if this membership is via another group or not, if so then add a note.
            Group via = findViaGroup(eperson, group);
            if (via != null)
              item.addHighlight("fade").addContent(T_indirect_member.parameterize(via.getName()));
           
          }
         
          if (groups.length <= 0)
            member.addItem().addHighlight("italic").addContent(T_member_none);
View Full Code Here

         
            select.setLabel(String.valueOf(policy.getID()));
            select.addOption(String.valueOf(policy.getID()));
           
            // Accounting for the funky case of an empty policy
            Group policyGroup = policy.getGroup();
           
            row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID() +
                "&object_id=" + objectID + "&object_type=" + objectType, String.valueOf(policy.getID()));
            row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID() +
                "&object_id=" + objectID + "&object_type=" + objectType, policy.getActionText());
            if (policyGroup != null) {
              Cell groupCell = row.addCell(1,2);
              groupCell.addContent(policyGroup.getName());
              Highlight groupHigh = groupCell.addHighlight("fade");
              groupHigh.addContent(" [");
              groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
              groupHigh.addContent("]");
            }
            else {
                row.addCell(1,2).addContent("...");
            }
View Full Code Here

TOP

Related Classes of org.dspace.eperson.Group

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.