Restrict Customer for Agent

Moderator: crythias

Locked
whyte
Znuny newbie
Posts: 4
Joined: 17 Oct 2011, 11:31
Znuny Version: 3.0.7

Restrict Customer for Agent

Post by whyte »

Hello,

I've configure lot of customer (around 100) and put some in a Group (around 10).
I've configure an Agent for this group, and he can see only this group, open ticket only for this 10 customer.

My problem is : when this restricted Agent want to create a Ticket he can see all the other customer who are not is his group.
(He can see in the CustomerSearchAutoComplete, CF Screenshot)

I need to restrict that, the agent should see only the 10 customer because of confidentiality.

Does there have any possibility to deal with ? (as in the code ?) :?

Thanks for your help.

My OTRS is in V3.1.12
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Restrict Customer for Agent

Post by reneeb »

If you use OTRS as the customer backend you might be interested in my commercial add-on "TaggedCustomerUsers" where you can assign tags to roles and customer to tags and agents of a given role can only see those customers assigned to the tags the agents role is assigned to.

Or you can program it on your own. To restrict customer access for agents is not implemented in OTRS.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
whyte
Znuny newbie
Posts: 4
Joined: 17 Oct 2011, 11:31
Znuny Version: 3.0.7

Re: Restrict Customer for Agent

Post by whyte »

Finaly i've find how to do it.
I've modify 3 files.

In the : System:CustomerUser.pm

Code: Select all

[...]
=item CustomerSearch()

to search users

    my %List = $CustomerUserObject->CustomerSearch(
        Search => '*some*', # also 'hans+huber' possible
        Valid  => 1, # not required, default 1
        User => 1,
    );

    my %List = $CustomerUserObject->CustomerSearch(
        UserLogin => '*some*',
        Valid     => 1, # not required, default 1
        User => 1,
    );

    my %List = $CustomerUserObject->CustomerSearch(
        PostMasterSearch => 'email@example.com',
        Valid            => 1, # not required, default 1
        User => 1,
    );

=cut
[...]
In the file : System:CustomerUser/DB.pm

Code: Select all

# build SQL string 2/2
    if ($Param{User}){
        if ($Param{User}!=1){
            $SQL .= " FROM $Self->{CustomerTable},group_customer_user, group_user ";
            $SQL .= " WHERE group_user.group_id=group_customer_user.group_id AND group_customer_user.user_id=customer_user.login AND ";
            $SQL .= " group_user.user_id='".$Param{User}."' AND ";
        }else{
            $SQL .= " FROM $Self->{CustomerTable} WHERE ";
        }
    }else{
        $SQL .= " FROM $Self->{CustomerTable} WHERE ";
    }
	
	
[...]

Code: Select all

	 if ($Param{User}){
        if ($Param{User}!=1){
            $SQL .= "GROUP BY group_customer_user.user_id";
        }
    }
    # check cache
And in the file : Modules:AgentCustomerSearch.pm

Code: Select all

my %CustomerUserList = $Self->{CustomerUserObject}->CustomerSearch(
            Search => $Search,
            User => $Self->{UserID},
        );
Now my agent can see on the users of his own group in the search field.
Anyway i was surprise that it's not an default configuration...
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Restrict Customer for Agent

Post by crythias »

whyte wrote:i was surprise that it's not an default configuration...
I'm not. Usually this is for teams of techs working together/hand off on various customers. It's not one agent->multiple customers. It's (default) one queue (What [types of] agents can handle your [service] request?)
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
rds
Znuny newbie
Posts: 2
Joined: 07 Apr 2019, 23:32
Znuny Version: 5 free

Re: Restrict Customer for Agent

Post by rds »

Hi whyte
I found your post from 2013 about restrikt some agents to one or some otrs customers.

i'm have nearly the same problem in a otrs 5 system. i want to restrict a "customer-Agent" to one customer.

are you still using this solution ?
do you use this solution also in otrs 5 or later ?

thank's,
rolf
Locked