473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

User Has Access To File/Folder

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.
Nov 18 '05 #1
3 1262
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/de...curityinfo.asp

"Davie" wrote:
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.

Nov 18 '05 #2
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.

"Davie" <dx*@mms.co.uk> ha scritto nel messaggio
news:e2**************@TK2MSFTNGP09.phx.gbl...
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.

Nov 18 '05 #3
yeah, but how would this notify me if the user has access??
"Cirrosi" <Ci****************@fastwebnet.it> wrote in message
news:4e*******************@tornado.fastwebnet.it.. .
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.

"Davie" <dx*@mms.co.uk> ha scritto nel messaggio
news:e2**************@TK2MSFTNGP09.phx.gbl...
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.


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter | last post by:
Hello! Please, could anybody tell me, is it possible to run an asp page as particular user? I have this situation where I have one shared folder on particular server and this folder is shared...
1
by: Kiran_Juikar | last post by:
In my application, I want to copy some file from network location to local machine folder. It works fine for administrator but If I run it with restricted user (not having permissions to local...
8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
0
by: John Dalberg | last post by:
I am trying to lock down file access of some sites in a shared hosting environment so that different users can only access their own site's directory with their asp.net code. However there's a...
2
by: flat_ross | last post by:
Hi, I am in a shop where developers are required to work off of a network share. This is so that code is backed up nightly. So I am testing running an ASP.NET Web application with a Class...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
2
by: Fox1977 | last post by:
Hi folks, Just wondering if anyone can help me out with this problem I'm having getting a particular .net web application to run on a windows 2003 r2 x64 platform running as a domain account. ...
2
dlite922
by: dlite922 | last post by:
I'm creating a batch file to be run on scheduled task on windows that sftp's a file using winscp to a linux machine. The password is saved in this bat file for all to see, so i need to create a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.