Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read him his rights
Message
De
07/05/2001 17:16:31
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
07/05/2001 07:14:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00501983
Message ID:
00504444
Vues:
19
>>>A technique that I used (a long time ago in 2.5/dos) to find if a user had sufficient rights to do something to a file was as follows...
>>>
>>>Try and rename the file to itself
>>>
Rename filename.exe to filename.exe
>>>If the user does not have NW rights an error is reported
>>>If the user has rights then a different error is reported (something like cannot rename to the same name)
>>>
>>>You need to have a localised error trapping routine for this but it does work (all this was on a Novell N/W but It may work in the same way)
>>
>>This sounds really interesting and looks like one of those neat VFP tricks
>
>Which technique did you use in the end?
>Just interested to see if my suggestion still works the way it used to.

I created the level-2 launchers, and put them into subdirectories below the actual .app files (going for .apps now). These subdirectories will be made readable or not by the end user (depending on the rights) and therefore the launchers will be visible or not. I only had to change the location of the executable to look for (stored in .ini file) in the level-1 launcher; the level-2 launcher is just a little 6-line prg, and I did just nothing to the apps themselves, except to check for a special parameter they'd get from the l-2 launcher, so they can't be ran by anything else.

If I had to rewrite the level-1 launcher, I'd probably go for your solution, though it wouldn't be the executable itself. From what I remember, Fox keeps the .exe open, and once one user is running it, you can't rename it even if you have all the rights you want... or would it be just another error to watch for. Still, I'm not sure it would give me both "you got no rights" and "though you got rights, you can't" versions of "sharing violation" error message. How did you solve that?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform