User Has Access To File/Folder

  • Thread starter Thread starter Davie
  • Start date Start date
D

Davie

I am new to .Net, so apologies if this is a simple question.

I need a way of display folders and files to my users. However, it must
show whether they have NTFS access to the file/folder.

For example, if they have access the folder or file is displayed as a link,
if they dont it is displayed only as text.

Is this possible? Any help would be greatly appreciated.
 
Interesting question.

My first thought would be to utilize Windows Authentication, then in the
code that generates the display I would iterate through the directories and
generate links, but I would wrap the code that generates the link with a
try/catch so that if an exception occurred trying to read the directory or
file I would just display the text instead of the link. Not sure if this is
the best solution or if it would work correctly, but thats my first thought.

Another thought would be to programmatically access the lower level windows
API functions to determine if a user is in the ACL (Access Control List) for
the directory or file. See:
http://msdn.microsoft.com/library/d...us/secauthz/security/getnamedsecurityinfo.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top