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

Check user's permissions

Hi!
I need to check what sub folders a user can access with a specific
folder as set as the parent e.g. c:\temp is the parent and c:\temp\one
and c:\temp\two are the sub folders. I need to find out if user x can
access folder one or two or both. How can this be done?
/erik
Aug 8 '08 #1
3 2229
On 08/08/2008 in message
<7f**********************************@8g2000hse.go oglegroups.cominga2005
wrote:
>Hi!
I need to check what sub folders a user can access with a specific
folder as set as the parent e.g. c:\temp is the parent and c:\temp\one
and c:\temp\two are the sub folders. I need to find out if user x can
access folder one or two or both. How can this be done?
/erik
There's a brilliant class on the Code Project:

http://www.codeproject.com/KB/files/...essRights.aspx

I use it in most of my apps.

--
Jeff Gaines Damerham Hampshire UK
All those who believe in psychokinesis raise my hand.
Aug 8 '08 #2
I need to check what sub folders a user can access with a specific
folder as set as the parent e.g. c:\temp is the parent and c:\temp\one
and c:\temp\two are the sub folders. I need to find out if user x can
access folder one or two or both. How can this be done?
This is tricky business. There are classes in .NET that deal with (some of)
these issues though I've never used them myself. Ultimately you can rely on
"AccessCheck()" in the WinAPI but you need solid security know-how to use
it. The docs provide a link to an example. Why not just temporarily
impersonate the target user however and see if you can access the folder the
way you want. That's the simplest route.
Aug 8 '08 #3
Interesting article.

Although I may be wrong, I did a quick scan through the article and
never saw any CAS checks.

Most people will never have problem with CAS because most of the code
runs with full privileges but if your code is limited by CAS then the
code in the article may end up throwing an exception if CAS does not
allow access to the folder being examined.

Again, I just took a quick glance at the article so I may be wrong but
I thought I would mention it.
On Aug 8, 2:02*pm, "Jeff Gaines" <jgaines_new...@yahoo.co.ukwrote:
On 08/08/2008 in message
<7fe6d0d6-75e1-424d-b380-fe02b9b20...@8g2000hse.googlegroups.cominga2005
wrote:
Hi!
I need to check what sub folders a user can access with a specific
folder as set as the parent e.g. c:\temp is the parent and c:\temp\one
and c:\temp\two are the sub folders. I need to find out if user x can
access folder one or two or both. How can this be done?
/erik

There's a brilliant class on the Code Project:

http://www.codeproject.com/KB/files/...essRights.aspx

I use it in most of my apps.

--
Jeff Gaines Damerham Hampshire UK
All those who believe in psychokinesis raise my hand.
Aug 8 '08 #4

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

Similar topics

3
by: dan glenn | last post by:
(PHP 4.3.4) THIS IS DRIVING ME NUTS! I have a website where I offer members their own bit of webspace to use and am coding a very simple 'filemanager' that allows a user to upload, delete, and...
2
by: gudia | last post by:
How would I, using a sql script, copy permissions assigned to a user or a role in one or more databases to another user or a role in their respective databases? Help appreciated
3
by: MLH | last post by:
I was running the following code while logged in as a user belonging only to the Users group. Set usrNew = .CreateUser(Me!UserID) 'The user ID is in a control on the form usrNew.PID =...
4
by: Steven | last post by:
Does anyone know if there is a way to check the access permissions of different users using C#? I need to know if a user has full control or if they have read only access or none to a certain...
8
by: Bernard Lebel | last post by:
Hello, I would like to know if there is a way to run a Python file under a different user account than the one logged in. Allow me to explain. There are a bunch of people here, they are "basic...
6
by: Fred W. | last post by:
When my application starts I need to check folder permissions to ensure they have "Full Control" before I let them proceed on. How can I check this permission. Thank you, Fred
1
by: kuntalshh | last post by:
I have automated setting the security permissions for a group "myGroup" for a folder "myfolder". Now the group contains user "myUser". I want to check whether myUser has same permissions as myGroup....
1
by: =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= | last post by:
Hello All, Our application write logs to a file in a folder. Before our application starts writing to that file, I want to check if the current user has write access to that file, for example,...
3
by: gareth | last post by:
Hi, Does anyone know of a way of finding out if the currently logged in user has read access to a directory without trying to open the directory?? Thanks gareth
1
by: Boozehound | last post by:
Hi, I've created a data access page for staff to verify their permissions on one of our systems. A section of the page has a list of permissions and whether it is currently available to them...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.