ACL configuration

Moderator: crythias

Locked
mariopel
Znuny newbie
Posts: 11
Joined: 18 Apr 2013, 22:02
Znuny Version: 3.2.5

ACL configuration

Post by mariopel »

Working with ACL I placed the example 5.4 of the operating administration within the / kernel / config.pm to configure ACL.

The result is the following error:

Global symbol "$ Self" requires explicit package name at C :/ OTRS / OTRS / Kernel / config.pm

What happens?

many Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL configuration

Post by crythias »

remove space.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
mariopel
Znuny newbie
Posts: 11
Joined: 18 Apr 2013, 22:02
Znuny Version: 3.2.5

Re: ACL configuration

Post by mariopel »

I reviewed the spaces.

I added the ACL script "book ordering" that is in the book in the file Kernel / config.pm as indicated.

Error: Global symbol "$ Self" requires explicit package name at C :/ OTRS / OTRS / Kernel / config.pm

I added a line of code my ($ Self) = @ _;
The error does not appear anymore but still does not work

As ACL settings should do?

Config.pm was as follows

Code: Select all

# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2013 xxx, 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.
# --
#  Note:
#
#  -->> Most OTRS configuration should be done via the OTRS web interface
#       and the SysConfig. Only for some configuration, such as database
#       credentials and customer data source changes, you should edit this
#       file. For changes do customer data sources you can copy the definitions
#       from Kernel/Config/Defaults.pm and paste them in this file.
#       Config.pm will not be overwritten when updating OTRS.
# --

package Kernel::Config;

use strict;
use warnings;
use utf8;

sub Load {
    my $Self = shift;

    # ---------------------------------------------------- #
    # database settings                                    #
    # ---------------------------------------------------- #

    # The database host
    $Self->{'DatabaseHost'} = 'localhost';

    # The database name
    $Self->{'Database'} = 'otrs';

    # The database user
    $Self->{'DatabaseUser'} = 'otrs';

    # The password of database user. You also can use bin/otrs.CryptPassword.pl
    # for crypted passwords
    $Self->{'DatabasePw'} = 'hot';

    # The database DSN for MySQL ==> more: "perldoc DBD::mysql"
    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

    # The database DSN for PostgreSQL ==> more: "perldoc DBD::Pg"
    # if you want to use a local socket connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
    # if you want to use a TCP/IP connection
#    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";
    # if you have PostgresSQL 8.1 or earlier, activate the legacy driver with this line:
#    $Self->{DatabasePostgresqlBefore82} = 1;

    # The database DSN for Microsoft SQL Server - only supported if OTRS is
    # installed on Windows as well
#    $Self->{DatabaseDSN} = "DBI:ODBC:driver={SQL Server};Database=$Self->{Database};Server=$Self->{DatabaseHost},1433";

    # The database DSN for Oracle ==> more: "perldoc DBD::oracle"
#    $ENV{ORACLE_HOME} = '/u01/app/oracle/product/10.2.0/client_1';
#    $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
#    $ENV{NLS_LANG} = "american_america.utf8";

#    $Self->{DatabaseDSN} = "DBI:Oracle:sid=OTRS;host=$Self->{DatabaseHost};port=1522;";

    # ---------------------------------------------------- #
    # fs root directory
    # ---------------------------------------------------- #
    $Self->{Home} = 'C:/OTRS/OTRS';

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #

    $Self->{'LogModule'}          = 'Kernel::System::Log::File';
    $Self->{'LogModule::LogFile'} = 'C:/OTRS/OTRS/var/log/otrs.log';
    # $DIBI$


    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this)                #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA);

use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');



[b]my ($Self) = @_;

# Added ACL for Book Ordering process[/b]
$Self->{TicketAcl}->{'P1-AD2-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD2'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Approval'],
},
},
};
$Self->{TicketAcl}->{'P1-AD3-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD3'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Approval denied'],
},
},
};
$Self->{TicketAcl}->{'P1-AD4-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD4'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Approved'],
},
},
};
$Self->{TicketAcl}->{'P1-AD5-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD5'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Order denied'],
},
},
};

$Self->{TicketAcl}->{'P1-AD6-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD6'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Order placed'],
},
},
};

$Self->{TicketAcl}->{'P1-AD7-1'} = {
Properties => {
Process => {
ActivityDialogEntityID => ['AD7'],
},
},
Possible => {
Ticket => {
DynamicField_Status => ['Shipment received'],
},
},
};
[b]# Added ACL for Book Ordering process[/b]


1; 
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ACL configuration

Post by crythias »

Please describe the problem as you're experiencing it, how to replicate it, what you expect to happen, what's not happening ... Things that might make it easier to assist you?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: ACL configuration

Post by EXG133 »

In my experience ACL's should always be entered in the Config.pm in the 'Own config options' section. Your ACL is in the 'system settings do not edit' section of the Config.pm. Perhaps that's what is causing the problem?

Code: Select all

    # ---------------------------------------------------- #
    # insert your own config settings "here"               #
    # config settings taken from Kernel/Config/Defaults.pm #
    # ---------------------------------------------------- #
    # $Self->{SessionUseCookie} = 0;
    # $Self->{CheckMXRecord} = 0;

    # ---------------------------------------------------- #

    # ---------------------------------------------------- #
    # data inserted by installer                           #
    # ---------------------------------------------------- #

    $Self->{'LogModule'}          = 'Kernel::System::Log::File';
    $Self->{'LogModule::LogFile'} = 'C:/OTRS/OTRS/var/log/otrs.log';
    # $DIBI$


    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
    #                                                      #
    # end of your own config options!!!                    #
    #                                                      #
    # ---------------------------------------------------- #
    # ---------------------------------------------------- #
Locked