Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Getting share & file permissions

Reply
Thread Tools

Getting share & file permissions

 
 
David Thielen
Guest
Posts: n/a
 
      12-30-2006
Hi;

Ok, I've almost got my system to handle opening files using any uname/pw
setup. One item remains.

If a share and file is set to allow "Everyone" then I want to allow any user
to open it. This requires either:
1) Is there a way to get the access rights for a share and for a file in the
share? In this case I can test for "Everyone" and have my ASP.NET user open
it.
2) Is there a way to impersonate an anonymous user and open it? This would
then fail if access was not set to Everyone.
3) Is there another way to do this?

BTW - once I get this part solved, I will put the full code in my blog and
post a link from here. This will give file access a system similiar to
XmlUrlResolver for http/ftp.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


 
Reply With Quote
 
 
 
 
Joe Kaplan
Guest
Posts: n/a
 
      12-31-2006
David, it is almost never a good idea to try to interpret the security
descriptor yourself. It is very easy to get the logic wrong.

Instead, the better thing to do is to call the Win32 AccessCheck API. Once
again, there is no good .NET equivalent, but I bet there is a wrapper
available at www.pinvoke.net or something.

Best of luck,

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"David Thielen" <> wrote in message
news:3608379F-99F1-4554-9910-...
> Hi;
>
> Ok, I've almost got my system to handle opening files using any uname/pw
> setup. One item remains.
>
> If a share and file is set to allow "Everyone" then I want to allow any
> user
> to open it. This requires either:
> 1) Is there a way to get the access rights for a share and for a file in
> the
> share? In this case I can test for "Everyone" and have my ASP.NET user
> open
> it.
> 2) Is there a way to impersonate an anonymous user and open it? This would
> then fail if access was not set to Everyone.
> 3) Is there another way to do this?
>
> BTW - once I get this part solved, I will put the full code in my blog and
> post a link from here. This will give file access a system similiar to
> XmlUrlResolver for http/ftp.
>
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
In-depth documenation on User Permissions, Group Permissions, ACLs, DCLs etc. Curt K ASP .Net 0 11-03-2006 04:54 PM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle ASP .Net 0 08-11-2004 02:04 PM
Re: Permissions - giving "everyone" full permissions is bad ? Scott Allen ASP .Net 0 07-13-2004 08:54 PM
Getting/setting Win32 Lanman share permissions Charles LaCour Perl 0 02-06-2004 02:33 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57