Author Topic: [solved] Disable security  (Read 7946 times)

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
[solved] Disable security
« on: February 11, 2015, 08:25:11 pm »
Hello,

is it possible to disable project security using the automation interface?
And/Or is it possible to trigger the unlocking of all current locked elements via the automation interface?

Thank you!

Best Regards,
Markus
« Last Edit: February 11, 2015, 09:52:05 pm by coatie »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Disable security
« Reply #1 on: February 11, 2015, 08:53:08 pm »
Disable security - doesn't sound like such a good idea.
Locking/unlocking elements via automation, yes entirely possible.

I've posted my code in a response to another issue http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1292436378/1#1
Use top left search button for similar issues.

Geert

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Disable security
« Reply #2 on: February 11, 2015, 09:09:59 pm »
Quote
Disable security - doesn't sound like such a good idea.

Well that's depending on the use case. We have a model within an Oracle DB and from time to time we trigger a project transfer to get a .eap JET DB. For the created JET DB we want to disable security and remove all locks automatically.

Could the unlocking be also achieved by removing all entries from the t_secklocks table (instead of looping and calling ReleaseUserLock)?
« Last Edit: February 11, 2015, 09:17:02 pm by coatie »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Disable security
« Reply #3 on: February 11, 2015, 09:29:21 pm »
Quote
Quote
Disable security - doesn't sound like such a good idea.

Well that's depending on the use case. We have a model within an Oracle DB and from time to time we trigger a project transfer to get a .eap JET DB. For the created JET DB we want to disable security and remove all locks automatically.

Could the unlocking be also achieved by removing all entries from the t_secklocks table (instead of looping and calling ReleaseUserLock)?
In that case, I agree that removing security is acceptable. I don't know by heart, but there will be a field somewhere in the database that controls this.
Yes, I think deleting all t_seclocks has the same effect (but will be finished in a fraction of the time)
You might need to reload the model in case EA already has some elements loaded and still thinks they are locked.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Disable security
« Reply #4 on: February 11, 2015, 09:37:01 pm »
You can disable user security by executing
Code: [Select]
DELETE FROM t_secpolicies WHERE Property='UserSecurity'When you restart EA user security is turned off.

The funny thing: when I run
Code: [Select]
INSERT INTO t_secpolicies (Property, Value) VALUES ('UserSecurity', 'Enabled')afterwards the record is not added. It looks like Repository.Execute does some filtering in the end?!

I'll try to use a native SQL client to see if that works. Anyhow you need to restart EA afterwards since the table is only checked at start of EA.

q.
« Last Edit: February 11, 2015, 09:37:52 pm by qwerty »

coatie

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Disable security
« Reply #5 on: February 11, 2015, 09:51:12 pm »
Both of you - thank you very much!

Markus

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: [solved] Disable security
« Reply #6 on: February 11, 2015, 10:45:40 pm »
PS: I just found the bug in my SQL. M$ Access does not like Value but it wants [Value]. So the Repository.Execute does not do filtering here. It just silently swallowed an invalid SQL (well, we're used to EA being "error tolerant"). So in the end, if you run a batch you can disable security.
  • Open an EA instance and delete the t_secpolicies record
  • Close EA and run your batch in a newly opened instance
  • Finally restore t_secpolicies
If you run that at night where you know that nobody has access I guess it's ok. Since an EA repository is not a bank this is an acceptable way, I think.

q.
« Last Edit: February 11, 2015, 10:46:22 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: [solved] Disable security
« Reply #7 on: February 11, 2015, 11:19:49 pm »
Quote
Since an EA repository is not a bank this is an acceptable way, I think.

q.
If the EA repository would be a bank I would be a multi-millionaire ;D

Geert