473,320 Members | 1,802 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,320 software developers and data experts.

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 2829
ASP.NET 2.0 Membership, Roles and Profiles

// learn more using these google search terms...
membership overview site:msdn2.microsoft.com
roles overview site:msdn2.microsoft.com
profiles overview site:msdn2.microsoft.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.googlegr oups.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...@REMOVETHISTEXTmetromilwaukee.comwrote :
ASP.NET 2.0 Membership, Roles and Profiles

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

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

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

news:11**********************@a34g2000cwb.googlegr oups.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
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...
27
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...
0
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...
6
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...
26
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...
3
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
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...
2
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...
2
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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.