473,802 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1280
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 programmaticall y 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="tr ue">

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.u k> ha scritto nel messaggio
news:e2******** ******@TK2MSFTN GP09.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******** ***********@tor nado.fastwebnet .it...
You can set in the web.config

<authentication =windows />
<identity impersonate="tr ue">

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.u k> ha scritto nel messaggio
news:e2******** ******@TK2MSFTN GP09.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
1662
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 for just one user to access it. I wrote an asp page wich should open a file from that shared folder. However because the folder is shared for just one user I have somehow to run the asp page as this user. The same way like in ASP.NET application...
1
7762
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 machine folder) it gives me Access denied error. How can I programmatically give permission to the foder for restrcited user.
8
2749
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 access to the network made through the application would be seen as 'C# application user' and not 'Bob'. What I want to accomplish is to create an encrypted folder on a server where files within the folder can be accessed through the application,...
0
1150
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 problem with some aspnet user access. After some experimenting with ntfs permissions, I noticed that any asp.net enabled site *must* have asp.net user have read access on the folder above the application folder plus have read access to the...
2
2651
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 assembly all on a shared drive. I have the solution working perfectly. However, I have run into a hiccup. In order to map IIS Virtual Dir to a network drive, you need
8
9480
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 System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
4
3540
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 objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
5
4099
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 both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
2
17706
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. Our current setup is as follows: We have a windows 2003 domain with 4 web servers in. Two of them are windows 2003 sp1 and I am trying to bring two new ones online. These
2
5967
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 user on the Linux machine that can't do anything but have write access to 1 folder. I don't want you to walk me through it from A to Z, but after I created the user, how do I do things like: - cannot log into server using command line (SSH),...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.