Kernel::System::ITSMConfigItem::Permission::ClassGroupCheck - check if a user belongs to a group
new()
create an object
use Kernel::Config;
use Kernel::System::Encode;
use Kernel::System::Log;
use Kernel::System::DB;
use Kernel::System::Main;
use Kernel::System::GeneralCatalog;
use Kernel::System::ITSMConfigItem;
use Kernel::System::ITSMConfigItem::Permission::ClassGroupCheck;
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 $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
MainObject => $MainObject,
);
my $ConfigItemObject = Kernel::System::ITSMConfigItem->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
);
my $GeneralCatalogObject = Kernel::System::GeneralCatalog->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
);
my $CheckObject = Kernel::System::ITSMConfigItem::Permission::ClassGroupCheck->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
ConfigItemObject => $ConfigItemObject,
GeneralCatalogObject => $GeneralCatalogObject,
);
Run()
this method does the check if the use belongs to a given group
my $HasAccess = $CheckObject->Run(
UserID => 123,
Type => 'ro',
ClassID => 'ITSM::ConfigItem::Class::Computer',
);
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 (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.