Re: Check access permissions on a file/folder
- From: "Henning Krause [MVP]" <newsgroups.remove@xxxxxxxxxxxxxxxxx>
- Date: Sun, 9 Apr 2006 23:15:53 +0200
Hello,
it's quite complicated to do this check manually since a security token can
have be restricted (deny-only group membership and so on). Additionally,
some security identifiers are bound to a machine (local administrator and so
on).
The only real method to check if a use has a set of permissions is to open
the file.
If you want to check only local files, you can however use P/Invoke and call
AccessCheck (in advapi32.dll). See the MSDN documentation on this function
for more.
Greetings,
Henning Krause
"krammai" <krammai@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F10CBFDE-E866-41AF-ACD4-B6083055E6AC@xxxxxxxxxxxxxxxx
Does .NET 2.0 provide an easy way to programatically determine if a user
has
permissions to access a particular file or folder? If yes, code snippets
would be greatly appreciated.
.
- Prev by Date: Re: SetOwner problem?
- Next by Date: Re: Using RSA public keys exported from Java or OpenSS ...
- Previous by thread: Re: SetOwner problem?
- Next by thread: Re: Using RSA public keys exported from Java or OpenSS ...
- Index(es):
Relevant Pages
|