Kernel::System::ITSMChange::ITSMWorkOrder::Permission::WorkOrderAgentCheck - workorder agent based permission check
new()
create an object
use Kernel::Config;
use Kernel::System::Encode;
use Kernel::System::Log;
use Kernel::System::Main;
use Kernel::System::Time;
use Kernel::System::DB;
use Kernel::System::ITSMChange::ITSMWorkOrder;
use Kernel::System::User;
use Kernel::System::Group;
use Kernel::System::ITSMChange::ITSMWorkOrder::Permission::WorkOrderAgentCheck;
my $ConfigObject = Kernel::Config->new();
my $EncodeObject = Kernel::System::Encode->new(
ConfigObject => $ConfigObject,
);
my $LogObject = Kernel::System::Log->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
);
my $MainObject = Kernel::System::Main->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
);
my $TimeObject = Kernel::System::Time->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
);
my $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
MainObject => $MainObject,
);
my $UserObject = Kernel::System::User->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
DBObject => $DBObject,
EncodeObject => $EncodeObject,
);
my $GroupObject = Kernel::System::Group->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
);
my $WorkOrderObject = Kernel::System::ITSMChange::ITSMWorkOrder->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
DBObject => $DBObject,
TimeObject => $TimeObject,
MainObject => $MainObject,
);
my $CheckObject = Kernel::System::ITSMChange::ITSMWorkOrder::Permission::WorkOrderAgentCheck->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
DBObject => $DBObject,
UserObject => $UserObject,
GroupObject => $GroupObject,
WorkOrderObject => $WorkOrderObject,
);
Run()
This method does the check. 'ro' access is granted when the agent is a 'ro' member of the 'itsm-change' group. 'rw' access is granted when the agent is the workorder agent of the workorder.
my $HasAccess = $CheckObject->Run(
UserID => 123,
Type => 'rw', # 'ro' or 'rw'
WorkOrderID => 4444, # optional for WorkOrderAdd
);
This software is part of the OTRS project (http://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (AGPL). If you did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
$Id: WorkOrderAgentCheck.pm,v 1.14 2010-10-21 16:11:31 ub Exp $