Author Topic: Model users mass management  (Read 4707 times)

Typia

  • EA User
  • **
  • Posts: 81
  • Karma: +1/-0
    • View Profile
Model users mass management
« on: June 15, 2021, 06:46:45 pm »
Hi guys,
I have a model with security enabled and users added over time (more than 100 ..)
I would like to clean up and remove every user in the model but local admin one.
Currently I can't select more than 1 user a the time and list is refreshed every time I click on delete.

Any way to mass modify users ?

Many thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +395/-301
  • I'm no guru at all
    • View Profile
Re: Model users mass management
« Reply #1 on: June 15, 2021, 07:00:03 pm »
You could run a repository.execute("DELETE FROM t_secuser WHERE userlogin <> 'admin'")

That's just out of my head without testing. So make a backup and try out.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13193
  • Karma: +549/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model users mass management
« Reply #2 on: June 15, 2021, 07:38:00 pm »
You could run a repository.execute("DELETE FROM t_secuser WHERE userlogin <> 'admin'")

That's just out of my head without testing. So make a backup and try out.

q.
I'm not sure if that is the best idea. You risk creating orphaned records at table such as t_secusergroup, t_secuserpermission, t_seclocks and maybe others.

It will be faster and safer to simply delete the 100 users using the GUI. That isn't going to take more than half an hour is it?

Geert

Typia

  • EA User
  • **
  • Posts: 81
  • Karma: +1/-0
    • View Profile
Re: Model users mass management
« Reply #3 on: June 15, 2021, 10:24:15 pm »
You could run a repository.execute("DELETE FROM t_secuser WHERE userlogin <> 'admin'")

That's just out of my head without testing. So make a backup and try out.

q.
I'm not sure if that is the best idea. You risk creating orphaned records at table such as t_secusergroup, t_secuserpermission, t_seclocks and maybe others.

It will be faster and safer to simply delete the 100 users using the GUI. That isn't going to take more than half an hour is it?

Geert

You're right.
atfer recount I had almost 500 users (imported from AD ..) I deleted manually