def can_edit(user, plan):
    """
    Can a user edit a plan?

    In order to edit a plan, Users must own it or be a staff member.
    Templates cannot be edited, only copied.

    Parameters:
        user -- A User
        plan -- A Plan

    Returns:
        True if the User has permissions to edit the Plan.

    """
    return (plan.owner == user
            or user.is_staff) and not plan.is_template and not plan.is_shared