Re: Check access permissions on a file/folder



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.


.



Relevant Pages

  • Re: Access permission
    ... have be restricted (deny-only group membership and so on). ... some security identifiers are bound to a machine (local administrator and so ... If you want to check only local files, you can however use P/Invoke and call ...
    (microsoft.public.dotnet.security)
  • Re: Computer startup script credencial
    ... permissions of the domain computer object elsewhere in the domain. ... I need to have a STARTUP script that the computer can execute but the ... The script changes the local administrator acount and the password is ... to modify the local Administrator password for computers in bulk. ...
    (microsoft.public.windows.server.general)
  • Re: Outlook Permissions - W2000
    ... Are you having problems while logged on as a local administrator? ... you mention such as cd burning or creating printers often require an administrator to ... --- Steve ... > to permissions because I've been having device permissions ...
    (microsoft.public.win2000.security)
  • Re: Cannot delete file - Unable to remove permissions
    ... As a local administrator you can take ownership. ... The file has NTFS permissions inherited and I am unable to modify/ ... does not have an owner.. ...
    (microsoft.public.windows.file_system)
  • Re: GP that prevents Users from running scirpts
    ... programas the local administrator ... prevent her from running scripts? ... where this app expects the logged-in user to have write access, ... the permissions accordingly in the file system & registry. ...
    (microsoft.public.windows.server.sbs)