|
-
Aug 20th, 2008, 08:44 AM
#1
Thread Starter
Fanatic Member
Obtaining security permissions on a folder
I've searched the forums, and it seems a lot of people are recommending GetAttr. Will GetAttr be able to read the NT security permissions of a given folder? For instance, the folder may not be read-only, but the user may not have the "create files/folders" permission, which would make it read-only in a sense. Will GetAttr be able to detect this?
-
Aug 20th, 2008, 09:31 AM
#2
Re: Obtaining security permissions on a folder
Nope, they are different things entirely.
What you can use is the GetFileSecurity API.
-
Aug 20th, 2008, 09:50 AM
#3
Thread Starter
Fanatic Member
Re: Obtaining security permissions on a folder
I'd be trying to create a file in a directory and want to check to make sure I can before doing so. Is there anything besides those two functions I should consider?
-
Aug 20th, 2008, 10:27 AM
#4
Re: Obtaining security permissions on a folder
There is one other thing I can think of which is Share permissions - but they only apply if it is a shared folder you are working with (and have connected to it as a share, as opposed to via the parent folders etc). Unfortunately I don't know how you can detect the permissions there.
I would suggest creating a test file, but then you may not be able to Delete or Edit it!
-
Aug 20th, 2008, 10:57 AM
#5
Thread Starter
Fanatic Member
Re: Obtaining security permissions on a folder
True. I'll just stick with the security permissions API for now. I'll write a quick sub and test it. I'll leave the thread open until I know for sure that it works.
-
Aug 20th, 2008, 01:10 PM
#6
Thread Starter
Fanatic Member
Re: Obtaining security permissions on a folder
It looks like GetFileSecurity is VERY complicated, or at least the example on allapi is complicated. Would it be possible to get a bit of a hand with how I would just determine whether a file has read/write permissions?
-
Aug 20th, 2008, 03:24 PM
#7
Re: Obtaining security permissions on a folder
It looks like this version might be easier to use: http://www.vbforums.com/showthread.php?t=81966
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|