Re: How to find out access permissions for files?

From: Michael Giagnocavo [MVP] (mggUNSPAM_at_Atrevido.net)
Date: 07/24/03


Date: Wed, 23 Jul 2003 17:19:34 -0600


On the CSharp page on gotdotnet.com they have a list of code
libraries. One of them is a library to work with ACLs. That should
be able to help you.
http://www.gotdotnet.com/team/csharp/code/default.aspx
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9

-mike
MVP

"Christoph Wienands" <cwienands@sswhiteburs.com> wrote in message
news:%23wy%23XBJUDHA.2008@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I'm currently trying to solve this problem:
>
> I have a web application that has the web.config setting
> <identity impersonate="true" userName="" password=""/>
> This means, the ASP application is executed under the user's
security
> context.
>
> In my application I want to display a list of files from the server
> (actually in a treeview). The user will only see the files that he
has read
> permissions for (based on NTFS security). First reason for this is,
the user
> will not click on files that he does not have access rights for,
second
> reason, administration can be done at the server side by simply
setting file
> security (just like for network shares).
>
> Now here's my problem: My application needs to find out, if the user
is
> allowed to access a certain file. One solution was to use
"File.OpenRead",
> which will throw an error is permission is denied. However, in case
there
> are a couple hundred files, I guess this will cause quite some
overhead.
>
> I looked at the FileIOPermission object but I couldn't figure out
how to use
> it in my case (or if it is suitable for my problem, it looks more as
a class
> to SET or GET permissions).
>
> Any other ideas?
>
> Thanks, Christoph
>
>



Relevant Pages

  • Re: compile+link Fujitsu Linux
    ... My security is better because it does not depend on file system permissions. ... You would do it by locking up the remote control, ... libraries was 'more secure'. ...
    (comp.lang.cobol)
  • Re: Refusing all permissions
    ... libraries which has extremely tight security (the libraries should refuse ... and see what permissions it is getting. ... Assembly declarative requests could be used for either one of the ...
    (microsoft.public.dotnet.security)
  • Re: compile+link Fujitsu Linux
    ... My security is better because it does not depend on file system permissions. ... completely independent of whether it uses libraries or individual ... take longer because you also load the library. ...
    (comp.lang.cobol)
  • How to find out access permissions for files?
    ... the ASP application is executed under the user's security ... permissions for. ... First reason for this is, ... will not click on files that he does not have access rights for, ...
    (microsoft.public.dotnet.security)
  • Re: compile+link Fujitsu Linux
    ... directory, change permissions all they want, and run their local copy to find out the ... Your notion of security by controlling ... libraries was 'more secure'. ... It seems that you allow them to break your by merely overwriting one ...
    (comp.lang.cobol)