Book a Demo

Author Topic: Generate security groups from script  (Read 3888 times)

JeffHamel

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Generate security groups from script
« on: September 05, 2012, 07:11:37 am »
Hi everyone,

Thank you for taking the time to read my topic.

Here's my situation :
We have to create a lot of security groups, users and set the groups permissions, in the project we are working on. Since I started using EA, I did a couple of vbscript to manage content in the Repository, so we didn't have to add a lot of things by hands (packages, diagrams, relationships, etc.). To do so, I used EA API's, so I have acces to most of the Repository's objects like Packages, diagrams, etc.

Now, I would like to know if there's a way to create security groups and users automatically from the content of, let say, an Excel sheet? In fact, we want an automation that could save us from creating over 1500 Security groups, 100-200 users and setting permissions to the groups one by one.

For now, all I found is the "ApplyGroupLock" Package Method, that could probably help me to set a GroupLocks to the packages. But I didn't find anything to help me to batch create security groups.

Maybe there's an other way to do so, but I just didn't think about it. So if you have a good idea, even if it's a completely different way to go, just let me know. All I want, is to save time and money.

Thank you for helping me!

Jeff

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate security groups from script
« Reply #1 on: September 05, 2012, 04:14:30 pm »
Jeff,

Unfortunately the security objects (users, groups, permission) have not been exposed in the API.
Luckily
a) the database structure for these objects is rather straightforward
b) there's a "secret" backdoor operation (Repository.Execute(SQLString)) to do updates on the database.

So if I were you I would start from the EA Excel Importer, and adjust it to import users and security groups instead of classes and attributes.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Generate security groups from script
« Reply #2 on: September 06, 2012, 07:45:25 pm »
Also have a look into my book Inside EA which details the internal structure of the security tables.

q.

JeffHamel

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Generate security groups from script
« Reply #3 on: September 07, 2012, 01:45:54 am »
Thank you very much guys!

Your answers were very helpful. I used the EA Excel Importer and modified it to do Inserts in the EA Repository with the Repository.Execute function and it works fine. I hope, Geert, this is what you meaned by ajusting it to import users and security groups? Nevertheless, this EA Excel Importer is a great tool and will be very useful to me. It saves me a lot of time.

Thank you!

Jeff

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate security groups from script
« Reply #4 on: September 07, 2012, 02:40:02 am »
Jeff, that's exactly what I meant.
I'm glad you got it working.

Geert