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

P

Paul Lemke

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
 
P

Paul Lemke

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?
 

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

Top