User Has Access To File/Folder

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.
 
G

Guest

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
 
C

Cirrosi

You can set in the web.config

<authentication=windows />
<identity impersonate="true">

In IIS uncheck anonymous and let windows authentication.

In this way the application impersonate the user connected and obtain his
privileges.

I tink this will work.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top