Book a Demo

Author Topic: Get current user without enabling security  (Read 5758 times)

magicscreen

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Get current user without enabling security
« on: May 25, 2016, 08:40:57 pm »
I am using the
Repository.GetCurrentLoginUser (boolean GetGuid = false)
method for get the current user of EA.

But if the Enable Security... menu option is off then I get this error:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in x.dll but was not handled in user code
Additional information: Security not enabled

Is there any other way to get the current user or do I have to enable the security always?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Get current user without enabling security
« Reply #1 on: May 25, 2016, 08:43:26 pm »
You can always ask the Windows API for the currently logged in user.

Geert

magicscreen

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Get current user without enabling security
« Reply #2 on: May 26, 2016, 12:16:42 am »
You can always ask the Windows API for the currently logged in user.

Geert

Thank you!  :)