#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RSApache::Command::XMLCommand;

#
# This class is intended to be the base class for our light-weight XML
# commands (like Ajax-style controls).
#
# The primary difference between this class and RPS::Command is that
# the basic tests for login and permissions will not return a redirect.
#

use strict;
use warnings;

use Apache2::Const qw(:common :http);

use lib '/app/tools/common/lib';
use RSApache::Command::SessionedCommand;
use RSApache::Response::Code;
use base 'RSApache::Command::SessionedCommand';

# derived commands will define this with their own app name
#
# sub app { return 'rps'; }

# !!! For now, just going to return error codes, and nothing else.
# It might be nice to also return some sort of message in the body of the
# reponse that explains what's going on.
# We're also using error codes in a way that doesn't totally match the
# http protocol spec...
#
sub invalidSessionResponse {
    my ($self) = @_;
    return RSApache::Response::Code->new(HTTP_UNAUTHORIZED);
}

sub accessDeniedResponse {
    my ($self) = @_;
    return RSApache::Response::Code->new(HTTP_FORBIDDEN);
}

###
1;    # Play nicely.
###
