head	1.22;
access;
symbols
	TIGRIS_1_1_0RC2:1.9.6.2
	TIGRIS_1_1_0RC1:1.9.6.2
	TIGRIS_1_1:1.9.6.2.0.2
	TIGRIS_1_0_8:1.9.6.2
	TIGRIS_1_0_8RC3:1.9.6.2
	TIGRIS_1_0_8RC2:1.9.6.2
	TIGRIS_1_0_8RC1:1.9.6.2
	TIGRIS_1_0_7:1.9.6.2
	TIGRIS_1_0_7RC3:1.9.6.2
	TIGRIS_1_0_7RC2:1.9.6.2
	TIGRIS_1_0_7RC1:1.9.6.2
	TIGRIS_1_0_6:1.9.6.2
	TIGRIS_1_0_6RC5:1.9.6.2
	TIGRIS_1_0_6RC4:1.9.6.2
	TIGRIS_1_0_6RC3:1.9.6.2
	TIGRIS_1_0_6RC2:1.9.6.2
	TIGRIS_1_0_6RC1:1.9.6.2
	TIGRIS_1_0_5:1.9.6.1
	TIGRIS_1_0_5RC6:1.9.6.1
	TIGRIS_1_0_5RC5:1.9.6.1
	TIGRIS_1_0_5RC4:1.9.6.1
	TIGRIS_1_0_5RC3:1.9.6.1
	TIGRIS_1_0_5RC2:1.9.6.1
	TIGRIS_1_0_5RC1:1.9.6.1
	TIGRIS_1_0_4:1.9.6.1
	TIGRIS_1_0_3:1.9
	TIGRIS_1_0_2:1.9
	TIGRIS_1_0_1:1.9
	TIGRIS_1_0:1.9.0.6
	TIGRIS_1_0_0:1.9
	TIGRIS_1_0_0_RC1:1.9.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.2
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.4
	TIGRIS_0_9_2_1:1.4
	TIGRIS_0_9_2:1.2.0.2
	TIGRIS_0_9_0:1.1.0.2;
locks; strict;
comment	@# @;


1.22
date	2001.08.28.17.13.34;	author leonardr;	state Exp;
branches;
next	1.21;

1.21
date	2001.08.11.09.08.08;	author dlr;	state Exp;
branches;
next	1.20;

1.20
date	2001.07.30.19.29.57;	author leonardr;	state Exp;
branches;
next	1.19;

1.19
date	2001.07.19.19.54.05;	author dlr;	state Exp;
branches;
next	1.18;

1.18
date	2001.07.18.10.05.15;	author dlr;	state Exp;
branches;
next	1.17;

1.17
date	2001.07.17.20.54.06;	author leonardr;	state Exp;
branches;
next	1.16;

1.16
date	2001.07.17.16.00.43;	author leonardr;	state Exp;
branches;
next	1.15;

1.15
date	2001.07.02.18.56.42;	author leonardr;	state Exp;
branches;
next	1.14;

1.14
date	2001.06.18.22.12.21;	author leonardr;	state Exp;
branches;
next	1.13;

1.13
date	2001.05.23.01.50.20;	author dlr;	state Exp;
branches;
next	1.12;

1.12
date	2001.05.17.14.51.17;	author leonardr;	state Exp;
branches;
next	1.11;

1.11
date	2001.05.01.21.47.22;	author leonardr;	state Exp;
branches;
next	1.10;

1.10
date	2001.04.27.23.01.46;	author edk;	state Exp;
branches;
next	1.9;

1.9
date	2001.03.07.01.53.27;	author lucas;	state Exp;
branches
	1.9.6.1;
next	1.8;

1.8
date	2001.03.02.00.28.01;	author leonardr;	state Exp;
branches;
next	1.7;

1.7
date	2001.02.26.22.03.26;	author leonardr;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.21.01.08.25;	author dlr;	state Exp;
branches;
next	1.5;

1.5
date	2001.02.08.20.37.34;	author leonardr;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.26.18.29.08;	author edk;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2001.01.26.05.24.07;	author edk;	state dead;
branches;
next	1.2;

1.2
date	2001.01.15.17.04.20;	author leonardr;	state Exp;
branches;
next	1.1;

1.1
date	2000.12.09.03.27.07;	author leonardr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.35.20;	author dlr;	state Exp;
branches;
next	;

1.4.2.1
date	2001.01.28.01.02.19;	author dlr;	state dead;
branches;
next	1.4.2.2;

1.4.2.2
date	2001.02.03.00.27.25;	author leonardr;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	2001.02.05.17.04.47;	author leonardr;	state Exp;
branches;
next	1.4.2.4;

1.4.2.4
date	2001.02.09.16.05.17;	author leonardr;	state Exp;
branches;
next	1.4.2.5;

1.4.2.5
date	2001.02.15.20.50.43;	author leonardr;	state Exp;
branches;
next	1.4.2.6;

1.4.2.6
date	2001.02.16.03.01.35;	author dlr;	state Exp;
branches;
next	1.4.2.7;

1.4.2.7
date	2001.02.20.04.16.27;	author dlr;	state Exp;
branches;
next	;

1.9.6.1
date	2001.04.27.23.07.36;	author leonardr;	state Exp;
branches;
next	1.9.6.2;

1.9.6.2
date	2001.05.24.23.31.10;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.22
log
@Completed migration of more methods to ContextAPI.
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */


package org.tigris.helm.security;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.turbine.util.Log;
import org.apache.commons.util.exception.NestableException;

import org.apache.velocity.context.Context;

import org.tigris.helm.*;
import org.tigris.helm.om.*;
import org.tigris.helm.security.*;
import org.tigris.helm.tool.DBFlag;
import org.tigris.helm.tool.ContextAPI;

/**
 * Edit a Role.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: RoleEdit.java,v 1.21 2001/08/11 09:08:08 dlr Exp $
 */
public class RoleEdit extends org.tigris.helm.security.HelmServlet 
{
    private static String SUBMIT_CHANGES_ACTION="Submit Changes";
    private static String DELETE_PERMISSIONS_ACTION="Delete Permissions";
    private static String NAME_FIELD="name";
    private static String DESCRIPTION_FIELD="description";
    private static String TYPE_FIELD="type";
    private static String REMOVE_PERMISSION_FIELD_PREFIX="Remove ";   

    private static String ROLE_ATTRIBUTE_PREFIX = "ROLE-ATTRIBUTE";

    /**
     *  Validate data and change the given Role.
     */
    protected String processRequest(Context context)
	throws NestableException, RedirectException
    {
	String templateName = super.processRequest(context);
        try 
        {
            String action = getAction(context);
            
            // Gather any user input, adding it to the context as well.
            String name = ContextAPI.processRequiredField
                (context, NAME_FIELD, "Role name");
            String description = ContextAPI.processRequiredField
                (context, DESCRIPTION_FIELD, "Description");
            String type = ContextAPI.processField
                (context, TYPE_FIELD, "Project");

            Role role = getCurrentRole(context);
            Domain domain = getCurrentDomain(context);
            AccessControlList acl = getLoginUser(context).getACL();
            
            if (SUBMIT_CHANGES_ACTION.equals(action))
            {               
                
                Map attributes = new HashMap();

                Enumeration paramNames =
                    ContextAPI.getRequest(context).getParameterNames();
                while (paramNames.hasMoreElements())
                {
                    String paramName = (String) paramNames.nextElement();
                    if (paramName.startsWith(ROLE_ATTRIBUTE_PREFIX))
                    {
                        StringTokenizer tok = new StringTokenizer(paramName);
                        tok.nextToken();
                        String attributeName = tok.nextToken();
                        String attributeValue =
                            ContextAPI.processField(context, paramName);
                        if (attributeValue.equals("on"))
                        {
                            attributeValue=DBFlag.ON;
                        }
                        attributes.put(attributeName, attributeValue);
                    }
                }

                if (ContextAPI.isValidUserInput(context))
                {
                    //Make the changes.
                    role.update(acl, name, description, role.getType(), 
                                attributes);
                    context.put("roleID", role.getID());
                    context.put("action", "");
                    redirectTo("RoleEdit");
                }             
            } 
            else if (action.equals(DELETE_PERMISSIONS_ACTION)) 
            {
                List permissionsToRemove = new ArrayList();
                Enumeration paramNames =
                    ContextAPI.getRequest(context).getParameterNames();
                while (paramNames.hasMoreElements())
                {
                    String paramName = (String) paramNames.nextElement();
                    if (paramName.startsWith(REMOVE_PERMISSION_FIELD_PREFIX))
                    {
                        StringTokenizer tok = new StringTokenizer (paramName);
                        tok.nextToken ();
                        Action remAction =
                            ActionPeer.getInstance(tok.nextToken());
                        Resource resource =
                            ResourcePeer.getInstance(tok.nextToken());
                        Permission permission = 
                            new Permission(remAction, resource);
                        permissionsToRemove.add(permission);
                    }
                }                    

                List projects = null;
                List users = null;
                //Remove requested permissions.
                for (Iterator i = permissionsToRemove.iterator(); 
                     i.hasNext();)
                {
                    Permission permission = (Permission)i.next();
                    role.removePermission(acl, permission);
                }

                context.put("roleID", role.getID());
                context.put("action", "");
                redirectTo("RoleEdit");
            }
        } 
        catch (RedirectException e) 
        {
            throw e;
        } 
        catch (Exception e) 
        {
            Log.debug("Exception in RoleEdit: ", e);
            throw new NestableException(e);
        }

        return templateName;  
    }
}
@


1.21
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d69 1
a69 1
 * @@version $Id: RoleEdit.java,v 1.20 2001/07/30 19:29:57 leonardr Exp $
d111 1
a111 1
                    getRequest(context).getParameterNames();                
d144 1
a144 1
                    getRequest(context).getParameterNames();
@


1.20
log
@Stop coddling IZ in terms of user accounts; assume that IZ can get its permissions from Helm through the XML-RPC interface.
@
text
@d55 1
a55 1
import org.apache.turbine.util.TurbineException;
d69 1
a69 1
 * @@version $Id: RoleEdit.java,v 1.19 2001/07/19 19:54:05 dlr Exp $
d86 1
a86 1
	throws TurbineException, RedirectException
d184 1
a184 1
            throw new TurbineException(e);
@


1.19
log
@Removed Joist references.
@
text
@d69 1
a69 1
 * @@version $Id: RoleEdit.java,v 1.18 2001/07/18 10:05:15 dlr Exp $
a106 1
                boolean recalculateIssueTracking = false;
a144 1
                boolean recalculateIssueTracking = false;
a157 4
                        if (remAction.isIssueTracking())
                        {
                            recalculateIssueTracking=true;
                        }
a169 8
                }

                if (recalculateIssueTracking)
                {
                    //We need to rebuild issue tracking for the whole
                    //site.
                    Host host = getHost(context);
                    host.rebuildIssueTracking();
@


1.18
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a50 1
import java.sql.*;
d56 1
a58 6
import org.joist.*;
import org.joist.util.*;
import org.tigris.helm.tool.SessionManager;

import org.tigris.helm.security.RedirectException;

d69 1
a69 1
 * @@version $Id: RoleEdit.java,v 1.17 2001/07/17 20:54:06 leonardr Exp $
@


1.17
log
@Cleanup for port to new error handling system.
@
text
@d63 1
a63 1
import org.joist.security.RedirectException;
d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.16 2001/07/17 16:00:43 leonardr Exp $
@


1.16
log
@Ported servlets over to the new error handling system.
@
text
@d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.15 2001/07/02 18:56:42 leonardr Exp $
d128 1
a128 1
                            processField(context, paramName);
@


1.15
log
@Implemented project-scoped roles.
@
text
@a56 1
import org.apache.turbine.util.TurbineException;
d69 1
d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.14 2001/06/18 22:12:21 leonardr Exp $
a97 9
            // If we are returning to this page as a result of an
            // error, we just want to refresh the display, without
            // doing any further action.
            String errorMessage = (String)context.get("Error");
            if (errorMessage != null)
            {
                action = null;
                appendToMessage(context, errorMessage);
            }
d100 6
a105 7
            ArrayList missingFields = new ArrayList();
            ArrayList validationErrors = new ArrayList();
            String name = processField(context, NAME_FIELD,
                                       "Role name", missingFields);
            String description = processField(context, DESCRIPTION_FIELD,
                                       "Description", missingFields);
            String type = processField(context, TYPE_FIELD, "Project");
d111 1
a111 1
            if (action != null && action.equals(SUBMIT_CHANGES_ACTION))
d114 1
a114 1

d137 1
a137 1
                if (isValidUserInput(missingFields, validationErrors))
a144 4
                } else {
                    // Report missing fields and validation errors.
                    reportInvalidUserInput(context, missingFields, 
                                           validationErrors);
@


1.14
log
@Huge patch of the day: Got rid of redundant HELM_DOMAIN table. The project representation of the domain and the host is now the canonical one. Host and Domain now subclass ProjectGroup. The canonical representation of a project's membership in a domain group is now the corresponding mapping in HELM_PROJECT_PROJECTGROUP. Schema changes: No more HELM_DOMAIN table (obviously); no more DOMAIN_ID in HELM_PROJECT; HELM_USER and HELM_VC_VIEW now have foreign keys in HELM_PROJECT instead of HELM_DOMAIN.
@
text
@d69 1
d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.13 2001/05/23 01:50:20 dlr Exp $
d139 4
d150 2
a151 2
                    role.update(acl, domain, name, description,
                                role.getType(), attributes);
d195 1
a195 1
                    role.removePermission(acl, domain, permission);
@


1.13
log
@Ported Helm from WebMacro to Velocity.
@
text
@d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.12 2001/05/17 14:51:17 leonardr Exp $
d197 1
a197 1
                    Project host = getHost(context).getSpecialProject();
@


1.12
log
@Refactored a lot of code to get rid of the good-looking but very slow IssueTrackingAccount{Descriptor,Map} classes. Also cleaned up the script-running interface quite a bit.
@
text
@d56 3
a58 1
import org.webmacro.servlet.*;
d62 1
a62 1
import org.joist.session.*;
d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.11 2001/05/01 21:47:22 leonardr Exp $
d90 2
a91 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d93 1
a93 1
	String templateName = super.processRequest(connection, context);
d127 1
a127 1
                    context.getRequest().getParameterNames();                
d160 1
a160 1
                    context.getRequest().getParameterNames();
d169 4
a172 2
                        Action remAction = ActionPeer.getInstance(tok.nextToken());
                        Resource resource = ResourcePeer.getInstance(tok.nextToken());
a204 1

d213 1
a213 1
            throw new HandlerException(e.getMessage());
d218 1
a218 4

} /* end class RoleEdit */


@


1.11
log
@Big architecture and schema change: booleans in the HELM_ROLE table have been replaced by entries in the HELM_ROLE_ATTRIBUTE_VALUE table. Also, a new attribute has been added which controls which roles a user gets upon creation of a project.
@
text
@a66 1
import org.tigris.helm.tool.task.IssueTrackingAccountDescriptor;
d72 1
a72 1
 * @@version $Id: RoleEdit.java,v 1.10 2001/04/27 23:01:46 edk Exp $
a178 2
                IssueTrackingAccountDescriptor before = null;
                IssueTrackingAccountDescriptor after = null;
a180 9
                if (recalculateIssueTracking)
                {
                    //All projects and users on the site are affected.
                    projects = getHost(context).getSpecialProject().expand();
                    users = getHost(context).getAllSiteUsers();
                    before = new IssueTrackingAccountDescriptor
                        (projects, users);
                }

d191 4
a194 3
                    after = new IssueTrackingAccountDescriptor
                        (projects, users);
                    before.syncTo(after, acl.getUser());
@


1.10
log
@use the same name for this form variable as is used in the template
@
text
@d73 1
a73 1
 * @@version $Id: RoleEdit.java,v 1.9 2001/03/07 01:53:27 lucas Exp $
a81 2
    private static String REQUESTABLE_FIELD="requestable";
    private static String DENOTES_OWNER_FIELD="ownership";
d84 2
d114 1
a114 2
            boolean requestable = processCheckbox(context, REQUESTABLE_FIELD);
            boolean denotesOwner = processCheckbox(context, DENOTES_OWNER_FIELD);
d121 20
d145 1
a145 1
                                role.getType(), requestable, denotesOwner);
d213 3
a215 1
        } catch (RedirectException e) {
d217 3
a219 1
        } catch (Exception e) {
@


1.9
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d73 1
a73 1
 * @@version $Id: RoleEdit.java,v 1.8 2001/03/02 00:28:01 leonardr Exp $
d83 1
a83 1
    private static String DENOTES_OWNER_FIELD="owner";
@


1.9.6.1
log
@Buddying edk's change to HEAD.
@
text
@d73 1
a73 1
 * @@version $Id: RoleEdit.java,v 1.9 2001/03/07 01:53:27 lucas Exp $
d83 1
a83 1
    private static String DENOTES_OWNER_FIELD="ownership";
@


1.9.6.2
log
@Ported task running system in from HEAD.
@
text
@d67 1
d73 1
a73 1
 * @@version $Id: RoleEdit.java,v 1.9.6.1 2001/04/27 23:07:36 leonardr Exp $
d161 2
d165 8
d184 3
a186 1
                    getHost(context).getSpecialProject().rebuildIssueTracking();
@


1.8
log
@Fixed redirects.
@
text
@a65 2
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d73 1
a73 1
 * @@version $Id: RoleEdit.java,v 1.7 2001/02/26 22:03:26 leonardr Exp $
@


1.7
log
@Almost got rid of dependance on hacky one-argument IssueTrackingAccountDescriptor.syncto().
@
text
@d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.6 2001/02/21 01:08:25 dlr Exp $
d129 3
a131 3
                    redirectToURL
                        (context, domain.getDomainHomeServletURL
                         ("RoleList"));
d191 3
a193 2
                redirectToURL
                    (context, domain.getDomainHomeServletURL("RoleList"));
d196 2
@


1.6
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.4.2.7 2001/02/20 04:16:27 dlr Exp $
d188 1
a188 1
                    before.syncTo(after);
@


1.5
log
@Added a new field to the Role table: ownership. This designates whether someone who has the role in the project/domain/host is the sort of person who gets emails when something happens that affects the project/domain/host.
@
text
@d2 1
a2 1
 * Copyright (c) 2000 CollabNet.  All rights reserved.
d55 1
a55 1
import org.webmacro.util.*;
a61 2
import com.workingdogs.village.*;

a62 1
import org.joist.database.*;
d65 3
a67 1
import org.tigris.helm.domain.*;
d69 1
a69 1
import org.tigris.helm.tool.IssueTrackingAccountDescriptor;
d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.4 2001/01/26 18:29:08 edk Exp $
a78 5
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4 2001/01/26 18:29:08 edk Exp $";

    private static Log log = new Log("ResAdd", "Role Add Servlet");
    private static boolean debug = true;

d85 1
a85 1
    private static String OWNERSHIP_FIELD="ownership";
d116 2
a117 4
            String requestableS = processField(context, REQUESTABLE_FIELD, "");
            boolean requestable = !requestableS.equals("");
            boolean ownership = processCheckbox(context, OWNERSHIP_FIELD);

d128 1
a128 1
                                role.getType(), requestable, ownership);
d136 5
a140 4
                }
             
            } else if (action.equals(DELETE_PERMISSIONS_ACTION)) {
                ArrayList permissionsToRemove = new ArrayList();
d151 2
a152 4
                        Action remAction = new Action(connection, dMgr, 
                                                   tok.nextToken());
                        Resource resource = new Resource(connection, dMgr,
                                                         tok.nextToken());
d154 1
a154 2
                            new Permission(connection, dMgr, remAction, 
                                           resource);
d188 1
a188 1
                    before.syncTo(connection, dMgr, after);
d192 1
a192 2
                    (context, domain.getDomainHomeServletURL
                     ("RoleList"));
d195 2
a196 11
        } catch (DataSetException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (SQLException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (JoistDatabaseException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (DoesNotExist e) {
            log.exception(e);
@


1.4
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d76 1
a76 1
 * @@version $Id: RoleEdit.java,v 1.2 2001/01/15 17:04:20 leonardr Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.2 2001/01/15 17:04:20 leonardr Exp $";
d91 1
d124 1
d136 1
a136 1
                                role.getType(), requestable);
@


1.4.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d76 1
a76 1
 * @@version $Id: RoleEdit.java,v 1.4 2001/01/26 18:29:08 edk Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4 2001/01/26 18:29:08 edk Exp $";
@


1.4.2.2
log
@Ported RoleEdit servlet.
@
text
@d55 1
a55 1
import org.apache.turbine.util.Log;
d62 2
d65 1
d68 1
a68 2
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d70 1
a70 1
//import org.tigris.helm.tool.IssueTrackingAccountDescriptor;
d82 3
d121 2
a122 1
            boolean requestable = processCheckbox(context, REQUESTABLE_FIELD);
d142 4
a145 5
                }             
            } 
            else if (action.equals(DELETE_PERMISSIONS_ACTION)) 
            {
                List permissionsToRemove = new ArrayList();
d156 4
a159 2
                        Action remAction = ActionPeer.getInstance(tok.nextToken());
                        Resource resource = ResourcePeer.getInstance(tok.nextToken());
d161 2
a162 1
                            new Permission(remAction, resource);
d171 2
a172 2
                //IssueTrackingAccountDescriptor before = null;
                //IssueTrackingAccountDescriptor after = null;
d180 2
a181 2
                    //before = new IssueTrackingAccountDescriptor
                    //(projects, users);
d194 3
a196 3
                    //after = new IssueTrackingAccountDescriptor
                    //(projects, users);
                    //before.syncTo(after);
d200 2
a201 1
                    (context, domain.getDomainHomeServletURL("RoleList"));
d204 11
a214 2
        } catch (Exception e) {
            Log.debug("Exception in RoleEdit: ", e);
@


1.4.2.3
log
@Put back usage of IssueTrackingAccountDescriptor in methods that should use it.
@
text
@d68 1
a68 1
import org.tigris.helm.tool.task.IssueTrackingAccountDescriptor;
d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.4.2.2 2001/02/03 00:27:25 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4.2.2 2001/02/03 00:27:25 leonardr Exp $";
d163 2
a164 2
                IssueTrackingAccountDescriptor before = null;
                IssueTrackingAccountDescriptor after = null;
d172 2
a173 2
                    before = new IssueTrackingAccountDescriptor
                        (projects, users);
d186 3
a188 3
                    after = new IssueTrackingAccountDescriptor
                        (projects, users);
                    before.syncTo(after);
@


1.4.2.4
log
@Changed role methods to use the ownership field.
@
text
@d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.4.2.3 2001/02/05 17:04:47 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4.2.3 2001/02/05 17:04:47 leonardr Exp $";
a85 1
    private static String DENOTES_OWNER_FIELD="owner";
d117 1
a117 1
            boolean denotesOwner = processCheckbox(context, DENOTES_OWNER_FIELD);
d128 1
a128 1
                                role.getType(), requestable, denotesOwner);
@


1.4.2.5
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.4.2.4 2001/02/09 16:05:17 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4.2.4 2001/02/09 16:05:17 leonardr Exp $";
@


1.4.2.6
log
@Added new imports necessitated by Torque.
@
text
@a66 1
import org.tigris.helm.om.base.*;
d74 1
a74 1
 * @@version $Id: RoleEdit.java,v 1.4.2.5 2001/02/15 20:50:43 leonardr Exp $
d78 1
a78 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.4.2.5 2001/02/15 20:50:43 leonardr Exp $";
@


1.4.2.7
log
@Removed useless versionID field.
@
text
@d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.4.2.6 2001/02/16 03:01:35 dlr Exp $
d79 2
@


1.3
log
@revert this stuff to its state as of 2001/01/24 12:42:00 GMT -- with
the following exceptions, which have some different modifications so
they'll work with changes which have happened in joist:

ProjectNewsEdit.java
SkinManager.java
SkinStyleElementValueManager.java
StyleElementManager.java
StyleManager.java

it compiles.  i dunno if it works, though.
@
text
@@


1.2
log
@Recalculate issue tracking accounts after adding or removing issue tracking permissions to or from a role.
@
text
@d76 1
a76 1
 * @@version $Id: RoleEdit.java,v 1.1 2000/12/09 03:27:07 leonardr Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.1 2000/12/09 03:27:07 leonardr Exp $";
@


1.1
log
@New servlet: RoleEdit
@
text
@d70 1
d76 1
a76 1
 * @@version $Id: RoleEdit.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $
d80 1
a80 1
    public static final  String versionID = "$Id: RoleEdit.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $";
d148 1
d163 4
d169 15
a183 2
                }    
                
d191 8
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d55 1
a55 1
import org.apache.turbine.util.Log;
d62 2
d65 1
d68 1
a68 3
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
a69 1
import org.tigris.helm.tool.task.IssueTrackingAccountDescriptor;
d75 1
a75 1
 * @@version $Id: RoleEdit.java,v 1.4.2.7 2001/02/20 04:16:27 dlr Exp $
d79 5
a89 1
    private static String DENOTES_OWNER_FIELD="owner";
d120 3
a122 2
            boolean requestable = processCheckbox(context, REQUESTABLE_FIELD);
            boolean denotesOwner = processCheckbox(context, DENOTES_OWNER_FIELD);
d133 1
a133 1
                                role.getType(), requestable, denotesOwner);
d141 4
a144 5
                }             
            } 
            else if (action.equals(DELETE_PERMISSIONS_ACTION)) 
            {
                List permissionsToRemove = new ArrayList();
a146 1
                boolean recalculateIssueTracking = false;
d154 4
a157 2
                        Action remAction = ActionPeer.getInstance(tok.nextToken());
                        Resource resource = ResourcePeer.getInstance(tok.nextToken());
d159 2
a160 5
                            new Permission(remAction, resource);
                        if (remAction.isIssueTracking())
                        {
                            recalculateIssueTracking=true;
                        }
d163 2
a164 15
                }                    

                IssueTrackingAccountDescriptor before = null;
                IssueTrackingAccountDescriptor after = null;
                List projects = null;
                List users = null;
                if (recalculateIssueTracking)
                {
                    //All projects and users on the site are affected.
                    projects = getHost(context).getSpecialProject().expand();
                    users = getHost(context).getAllSiteUsers();
                    before = new IssueTrackingAccountDescriptor
                        (projects, users);
                }

a171 8

                if (recalculateIssueTracking)
                {
                    after = new IssueTrackingAccountDescriptor
                        (projects, users);
                    before.syncTo(after);
                }

d173 2
a174 1
                    (context, domain.getDomainHomeServletURL("RoleList"));
d177 11
a187 2
        } catch (Exception e) {
            Log.debug("Exception in RoleEdit: ", e);
@


