[Tutor] "Generic" GetUser
Colin Campbell
ccampbell@ede.org
Tue, 25 Jun 2002 17:02:19 -0600
G'day, eh!
I have an Excel workbook containing many tabs of financial reports. An
autorun macro looks up the user login in a table and hides the sheets they
are not allowed to see. There are 2 obvious problems: I can't guarantee
that the macro is run, and since it makes and API call to Windows, my Mac
users are doomed.
I have found the win32wnet.WNetGetUser() in ActivePython, so that I don't
have to trust users to enable macros. This in turn means that my next trick
is to write a Python front end which handles the security, perhaps even by
copying the allowed sheets into a temporary workbook or even creating HTML,
depending on the level of my ambition.
My question is this: is there a more generic method or property that is
available across all platforms/python implementations, which will return
the network login of the person running the program?
TIA,
Colin
--
I believe that the first test of a truly great man is his humility. I do
not mean by humility, doubt of his own powers. But really great men have a
curious feeling that the greatness is not in them, but through them. And
they see something divine in every other man and are endlessly, foolishly,
incredibly merciful.
-John Ruskin, author, art critic, and social reformer (1819-1900)