Agents must not create new customers


#1

Hey guys,

we need the ability to prevent agents from wildly creating new customers in the “create ticket” form - I would suggest an additional checkbox within role management.

In the meantime - if possible - a (hardcoded) workaround would be much appreciated, so that only admins are allowed to add customer users.

Have a nice day


#2

Thanks for posting.

Would you mind telling us the use case here? It’s just so we can understand the reason better. :slight_smile:


#3

Right now, we are using Zammad for internal requests only. Those are basically requests from external customers (who must not be notified about it) but all tickets are solely created and handled by our agents.

That is why the agents are supposed to always set their own user as customer when creating new tickets. But there are always some employees who nevertheless try to enter the external customer.

As a result our Zammad instance clutters up and will create error messages when it tries to send mails to customers without mail addresses.

Channel: Email::Account out Can't use Channel::Driver::Smtp: #<Net::SMTPSyntaxError: 501 5.5.4 Invalid Address

(By the way, how do you flush the mail queue or clear this error state?)

Even in the future, when we start using Zammad with tickets directly created by external customers, adding new customer users to the system should be always restricted to our admins or customized mini-admins.


#4

Ummm… wow okay.
Flushing your postqueue (postfix cmd) strongly depends on your MTA you’re using.

Thanks for clarifying your use case. :slight_smile:

Postifx:

  • postqueue -f (flush, tries to resend all mails)
  • postsuper -d ALL (removes ALL E-Mails from queue, potential data loss!)

#5

I’m sorry, I did not mean the MTA mail queue but the Zammad internal queue or background job thing where notifications are generated. I want to clear the Zammad monitoring state and stop further attempts within the system to send the stuck notification.

Job Observer::Ticket::Article::CommunicateEmail::BackgroundJob

E, [2018-09-14T10:06:56.155991 #50671] ERROR -- : 2018-09-14T10:06:56+0200: [Worker(host:zammad.domain.tld pid:50671)] Job Observer::Ticket::Article::CommunicateEmail::BackgroundJob (id=10446) FAILED (3 prior attempts) with RuntimeError: Can't use Channel::Driver::Smtp: #<Net::SMTPSyntaxError: 501 5.5.4 Invalid Address")


#6

I’m currently trying to find a workaround, but I’m not familiar with the Zammad code or Ruby on Rails. I added a new permission row to the Zammad database and fiddled with

/opt/zammad/db/seeds/permissions.db
/opt/zammad/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.coffee
/opt/zammad/app/assets/javascripts/app/controllers/agent_ticket_create.coffee

but how do I hide the “add new customer” button in the new ticket form if this permission is not part of the users role? Of course adding “requiredPermission: ‘ticket.create_customer’” to “class UserNew extends App.ControllerModal” would be too simple :smile:

For now I just nuked the content of this file and agents can no longer access the new customer form.
/opt/zammad/app/assets/javascripts/app/views/generic/object_search/new_object.jst.eco


#7

Maybe @thorsteneckel can help here if he got some spare time. :slight_smile:


#8

We kinde have the same need but another scenario.

All our users are imported from our ldap directory and we try to keep it that way.
If a user does not appear in zammad it means it hasn’t been created in our directory.

Not all agents have access to that directory to correct that mistake so they create a “wrong” customer inside of zammad. 'til now we don’t have any way to prevent that. So the zammad admin has to clean up all those “wrong” customers.

A switch to disable customer creation (just like you can do it with tags) would be insanely useful.

cheers


#9

I would like, that no one have Access to the new customer form. I cleared the /opt/zammad/app/assets/javascripts/app/views/generic/object_search/new_object.jst.eco file and restarted the Server. After I log me in, I create a new ticket and can add still a new customer. The file new_object.jst.eco is empty. Can you tell me what I do wrong?
Thank you


#10

This is the sample problem i want to prevent thats whay i also request the same feature Creation of New Customer (in ROLE)

To contain who’s group can only create new customer,


[duplicate] Creation of New Customer (in ROLE)
#11

Charburner wrote in Sept 2018, that he just nuked the Content of this file (new_object.jst.eco) and that the box “create new customer” is not anymore available.
I just tried this Workaround too and it doesn’t work and I don’t know why. For me it’s fine, when I can deactivate that in general, I don’t need to have this in a Role.


#12

Now it’s working: After the change in the new_object.jst.eco file, I didnt know, that i need to run rake.
zammad run rake assets:precompile
than restart zammad service and after that, everything is working fine.


#13

Hi Sir @MrGeneration want to confirm if only the creating of new customer in the creation of new ticket only touched. After the change in the new_object.jst.eco file,


#14

Changing Zammad files is not update safe and requires a precompile after changing to apply them.


#15

Looking also for this feature :slight_smile:

Unfortunately not all agents are able to stick to the “rules” while creating new customers. So it takes us Admins a lot of time to clean up this mess afterwards.

A simple workaround would also help, but honestly I don’t want to mess with the existing code :wink: