I'm having a really hard time getting the UserID for a module I'm working, I've never programmed on OTRS before so I feel I'm missing something very basic here.
This is the code I'm working:
Code: Select all
GROUP: for my $Group (@Groups) {
next GROUP if !$Kernel::OM->Get('Kernel::System::Group')->PermissionCheck(
UserID => $Self->{UserID},
GroupName => $Group,
Type => 'rw',
);
$Access = 1;
last GROUP;
}
This is my object dependencies:
Code: Select all
our @ObjectDependencies = (
'Kernel::Config',
'Kernel::Language',
'Kernel::Output::HTML::Layout',
'Kernel::System::Log',
'Kernel::System::Web::Request',
'Kernel::System::User'
);
Code: Select all
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless( $Self, $Type );
$Self->{ConfigObject} = $Kernel::OM->Get('Kernel::Config');
$Self->{LanguageObject} = $Kernel::OM->Get('Kernel::Language');
$Self->{LayoutObject} = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
$Self->{LogObject} = $Kernel::OM->Get('Kernel::System::Log');
$Self->{ParamObject} = $Kernel::OM->Get('Kernel::System::Web::Request');
$Self->{UserObject} = $Kernel::OM->Get('Kernel::System::User');
return $Self;
}
Thank you.