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

Check users directory permissions

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

Jul 5 '07 #1
3 2333
Gareth,

What kind of access are you looking for? I would try and get the
DirectoryInfo instance for the directory. Once you have that, you can call
the GetAccessControl method which will return a DirectorySecurity instance
that gives you information about the permissions on the directory.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gareth" <ga****************@gmail.comwrote in message
news:11**********************@n2g2000hse.googlegro ups.com...
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

Jul 5 '07 #2
"gareth" <ga****************@gmail.comwrote in message
news:11**********************@n2g2000hse.googlegro ups.com...
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

This is not as easy as it looks like, I'm also not clear on why you need to
know why a user as read access to a *directory*, users are opening/reading
files not directories, and having read access to a directory doesn't
guarantee read access to a file contained in that directory.
Willy.

Jul 5 '07 #3
Hello Nicholas/Willy,

I'm trying to create a directory/file browser front end for a number
of Crystal Reports. The reports will be stored in a directory
structure according to the type of report that is being stored there,
e.g. telephony, IT, management etc.

It's a requirement that these reports can only be looked at by certain
people, i.e. non-management staff can't run management reports. The
easiest way to manage this is by using the file permissons on the
crystal reports and checking them against the currently logged in
user.

However, it's also a requirement that, if a user can't run a report
they can't even see it - so I need to check the permissions of each
file.

There is a similar requirement for the directories - if a user doesn't
have access to the directory, they can't see it.

Hope this makes sense...it's early!! :o)

Gareth

Jul 6 '07 #4

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

Similar topics

15
by: scmiles | last post by:
I am trying to write an asp or aspx page that will create a virtual ftp directory to the users Active Directory home directory. That way a user can interact (drag/drop, copy/paste) via IE with...
5
by: Ross Presser | last post by:
As our customers demand that we tighten our IT security in the company, I've been asked to prepare a report quarterly showing, for each user in Active directory, what his effective permissions are...
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...
6
by: Mr Newbie | last post by:
Hi, Im in a situation where I need to restrict users, but I dont have access or wont be allowed access to manage groups in the domain. How can I restrict access is this case ? -- Best...
9
by: jab3 | last post by:
So I'm considering a small project that involves online file storage. Let's say I wanted to set up a site that allows people to log-on, create an account, and then have space to upload files. The...
1
by: Alex Maghen | last post by:
Hi. I am trying to configure a development server environment as follows: Windows Server 2003 - HTTP/IIS/ASP.NET 2.0 is a server which is on a Windows Domain. I want to create a Site in IIS whose...
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
2
by: Paul Lemke | last post by:
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...
5
by: ashok90 | last post by:
hi Experts, I want to use Active Directory with C# .Net. My Problem is that i want to restrict some users on my system(which is not on any network) from accessing some applications like oracle,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.