473,657 Members | 2,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check if an authenticated user can write to a file/directory?

Hello, I currently have an application that uses authenticates users
via NTLM. I would like to provide a user a directory listing of a
folder. Everyone has read access to the folder, but the only folders
that should show up are ones that allow them to modify sometime.

I can list the directories/files just fine using directoryinfo/
fileinfo. But how can i tell if the current authenticated user has
NTFS write/modify permissions on those directories or files?

Any help is appreciated!
Thanks
Paul

Feb 14 '07 #1
2 2847
ASP.NET 2.0 Membership, Roles and Profiles

// learn more using these google search terms...
membership overview site:msdn2.micr osoft.com
roles overview site:msdn2.micr osoft.com
profiles overview site:msdn2.micr osoft.com

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-...8&z=17&l=0&m=h

"Paul Lemke" <le*****@gmail. comwrote in message
news:11******** **************@ a34g2000cwb.goo glegroups.com.. .
Hello, I currently have an application that uses authenticates users
via NTLM. I would like to provide a user a directory listing of a
folder. Everyone has read access to the folder, but the only folders
that should show up are ones that allow them to modify sometime.

I can list the directories/files just fine using directoryinfo/
fileinfo. But how can i tell if the current authenticated user has
NTFS write/modify permissions on those directories or files?

Any help is appreciated!
Thanks
Paul

Feb 14 '07 #2
I know about membership, roles, and profiles. Thanks for the links...
But i think you might have misunderstood me.

What i'd like to do...

Create a function that has inputs of the logged in user, and a folder/
file path. The function then checks to see if that user can write to
the folder or file. Returns a boolean as a result.

How can i check to see if the user can write to the directory?

An option i had was to try and write to the directory by impersonating
the user, and then just trap the error. That solution probably
wouldn't scale very well if there are 100's of folders in the
directory.

Help?
On Feb 14, 9:56 am, "clintonG"
<csgallag...@RE MOVETHISTEXTmet romilwaukee.com wrote:
ASP.NET 2.0 Membership, Roles and Profiles

// learn more using these google search terms...
membership overview site:msdn2.micr osoft.com
roles overview site:msdn2.micr osoft.com
profiles overview site:msdn2.micr osoft.com

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URLhttp://clintongallaghe r.metromilwauke e.com/
MAPhttp://wikimapia.org/#y=43038073&x=-88043838&z=17&l =0&m=h

"Paul Lemke" <lemk...@gmail. comwrote in message

news:11******** **************@ a34g2000cwb.goo glegroups.com.. .
Hello, I currently have an application that uses authenticates users
via NTLM. I would like to provide a user a directory listing of a
folder. Everyone has read access to the folder, but the only folders
that should show up are ones that allow them to modify sometime.
I can list the directories/files just fine using directoryinfo/
fileinfo. But how can i tell if the current authenticated user has
NTFS write/modify permissions on those directories or files?
Any help is appreciated!
Thanks
Paul

Feb 14 '07 #3

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

Similar topics

2
1866
by: Henry Hartley | last post by:
I've got a web site that has a mix of public and private sections. When you first come to the site, the final option on the menu is "Private" which forces an authentication and then gives you an expanded menu that includes all the private sections of the site. What I'd like to do is give users the proper menu ("public only" or "public and private") depending on whether they have authenticated with the site. I thought of just checking...
27
7111
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the user accesses it (not just once and then store it in the session). If a secure app is multi-page,...
0
1383
by: Haim Ashkenazi | last post by:
Hi A client of mine wants me to write a simple web interface for qmail's autorespond. this means that a user must authenticate with his system user/password, and then make some changes to the files on the user home directory. since this is done through NIS, it can't be done as root, and must be done as the user. I have 2 problems to solve: 1. authentication: the user must authenticate as a NIS user. this can be done by apache, but the...
6
4735
by: joethis | last post by:
Is there a way to make sure that a file is already in use using asp? For instance, if one person has opened a file and is about to write to it; then is there a way to keep another user from reading, or writing to that text file until the first user is finished?
26
2440
by: ValK | last post by:
Hi, Here is my problem. I need to check if scanner finished scanning the document. I'm using scanner interface that came with the scanner. I tried to open file and catch IO Exception for "The process cannot access the file ....., because it is being used by another process." It worked with .PDF but not with TIF files. It will allow me to open file while scanning.
3
4591
by: shapper | last post by:
Hello, How to I check if a user is authenticated and if it is what is its role? I am using Asp.Net 2.0 and forms authentication. Thanks, Miguel
9
15516
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and check the password. The thing is I can't access the password attribute to compare with the user's password provided.
2
1367
by: shapper | last post by:
Hello, I need to check if the current user is authenticated and get its profile. For authentication checking I got the following options: Request.IsAuthenticated.ToString My.User.IsAuthenticated.ToString User.Identity.IsAuthenticated.ToString
2
1628
by: shapper | last post by:
Hello, How can I check if a user is authenticated? I am using ASP.NET Membership forms authentication. Thanks, Miguel
0
8726
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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
5632
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
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.