Listing the contents of a network directory - user permissions

I

Ian

All,

I need to list within a web page the contents of a network directory,
this needs to be based on the user permissions of the user viewing the
web page.

For example,

User A can see the following directories :

dirA
dirB
dirC

User B has only rights to the following directories :

dirA
dirB

Directory 'dirC' will remain hidden from to User B.

The displaying of files within a network directory is easy enough, it's
the displaying of files based on user permissions that's the issue.

Any comments/suggestions welcome!

TIA
Iain
 
G

Guest

All,

I need to list within a web page the contents of a network directory,
this needs to be based on the user permissions of the user viewing the
web page.

For example,

User A can see the following directories :

dirA
dirB
dirC

User B has only rights to the following directories :

dirA
dirB

Directory 'dirC' will remain hidden from to User B.

The displaying of files within a network directory is easy enough, it's
the displaying of files based on user permissions that's the issue.

Any comments/suggestions welcome!

TIA
Iain

You wold need to impersonate current user to run with the permissions
of the current user.
http://msdn.microsoft.com/en-us/library/aa292118.aspx
 
I

Ian

Alexey said:
You wold need to impersonate current user to run with the permissions
of the current user.
http://msdn.microsoft.com/en-us/library/aa292118.aspx

Yes, I saw the ASP.NET impersonation article(s), only thing that is
puzzling me is can you dynamically changes the values of :

<identity impersonate="true"
userName="domain\user" <----------- this value
password="password" /> <----------- this value

Can you pass the current user into the web.config identity impersonate
section?
 
G

Guest

Yes, I saw the ASP.NET impersonation article(s), only thing that is
puzzling me is can you dynamically changes the values of :

<identity impersonate="true"
           userName="domain\user"      <----------- this value
           password="password" />      <----------- this value

Can you pass the current user into the web.config identity impersonate
section?

You should use userName and password attributes only when you need to
impersonate the token with a specific identity. In order to get the
token impersonated by the current user you should use <identity
impersonate="true" /> and <authentication mode="Windows" />. See the
matrix that illustrate the resultant identity
based on settings. http://msdn.microsoft.com/en-us/library/aa302377.aspx

Hope this helps
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top