473,466 Members | 1,406 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB-WEB: File rights based by session, possible?

12 New Member
Hello,

Im facing problem that i have files in 1 folder, who has access to files should be based to session information. Basically folder is configured that iis user has rights to folder. Now that i list users files i can ofc narrow the files so that only logged users files are shown, however he still can see others files by changing url. Anyone got idea if i can manage filerights by session or got way around the problem?

Platform im using is IIS, .net framework 2.0
Dec 17 '07 #1
1 965
Frinavale
9,735 Recognized Expert Moderator Expert
Hello,

Im facing problem that i have files in 1 folder, who has access to files should be based to session information. Basically folder is configured that iis user has rights to folder. Now that i list users files i can ofc narrow the files so that only logged users files are shown, however he still can see others files by changing url. Anyone got idea if i can manage filerights by session or got way around the problem?

Platform im using is IIS, .net framework 2.0
There's a couple of ways to handle this.
You could set a session variable to indicate what rites the user has to files and check this variable during every page load to see if they are permitted to view the file...if they aren't you could just redirect them to the login page (or wherever).

If you are using forms authentication, you can also deny access to files by any user that is not authenticated by setting your web.config file to:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3.     <system.web>
  4.         <authorization>
  5.             <allow roles="users" />
  6.             <deny users="?" />
  7.         </authorization>
  8.     </system.web>
  9. </configuration>
What you do here is place all of your restricted files into a folder and add a web.config file to that folder with these settings....

-Frinny
Dec 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Terry | last post by:
Hi, I need some feedback. We are converting to .Net and we are trying to decide on whether to use VB.net or C#.net. As far as our current systems, they will probably be rewritten in ASP.Net. I...
31
by: Rena | last post by:
Hi all, I really would like to know the managment of MS, will put more effort on either VB or C#, because I believe there are not fair balance in the world. I used to VB 6.0, and now working on...
6
by: lastusernameleft | last post by:
i've been researching this issue for a while and can't come to any conclusive answer, mostly it seems to be a preference over syntax, some saying c# is elegant while vb is clunky, or that c# is...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
2
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or...
62
by: zacks | last post by:
A co-worker where I work is proposing all future code devopment be done in Visual C#. Here is his assessment of VB: VB.NET is hack as far as the CLR(Common Language Runtime) goes. It was...
15
by: Manny Chohan | last post by:
Hey Guys, Can some one tell me why is there more demand for C# vs VB .NET? Personally i have programmed in VB .net a little bit and have found it easier to use. Is there any hidden secret...
111
by: =?Utf-8?B?bWFyaw==?= | last post by:
Fact Poll I made the transition from (Borland) C++ to VB.NET around 2004. I have been happy with the choice. I find I can focus more on the problem and less on being "tidy" with VB. But, I...
3
by: Dhananjay | last post by:
Hi All, I am facing problem when i am converting C#.net code(Delegate concept) into vb.net. I am unable to do that . Can someone help me to solve the problem. I am providing my C#.net code. ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.