473,796 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

find out if the user has enough rights to open a page

Hi all,

How do I find out if the current visitor of my page has enough rights to
open another page on the same server?
I need this to show a link to that page only when the visitor can actually
visit that page and will not get an 'access denied' message.

IOW, I'm looking for the implementation of the following function:

Public Function CurrentUserCanO penPage(ByVal TheURL As String) As Boolean
'determine if the current user can open the page with the given URL
End Function

TIA,

Corno
Nov 19 '05 #1
4 1371
It depends a great deal on how the authorization is being done. Are you
using Windows ACLs or a custom role-based mechanism or something else?

Joe K.

"Corno" <Corno@dds%FAKE %.nl> wrote in message
news:eN******** *****@TK2MSFTNG P10.phx.gbl...
Hi all,

How do I find out if the current visitor of my page has enough rights to
open another page on the same server?
I need this to show a link to that page only when the visitor can actually
visit that page and will not get an 'access denied' message.

IOW, I'm looking for the implementation of the following function:

Public Function CurrentUserCanO penPage(ByVal TheURL As String) As Boolean
'determine if the current user can open the page with the given URL
End Function

TIA,

Corno

Nov 19 '05 #2
If u r using urs own authentication then the given function is correct but
in that case you must have stored the access right information regarding
each page in the database or somewhere else.

"Joe Kaplan (MVP - ADSI)" <jo************ *@removethis.ac centure.com> wrote
in message news:e4******** ********@TK2MSF TNGP14.phx.gbl. ..
It depends a great deal on how the authorization is being done. Are you
using Windows ACLs or a custom role-based mechanism or something else?

Joe K.

"Corno" <Corno@dds%FAKE %.nl> wrote in message
news:eN******** *****@TK2MSFTNG P10.phx.gbl...
Hi all,

How do I find out if the current visitor of my page has enough rights to
open another page on the same server?
I need this to show a link to that page only when the visitor can
actually visit that page and will not get an 'access denied' message.

IOW, I'm looking for the implementation of the following function:

Public Function CurrentUserCanO penPage(ByVal TheURL As String) As Boolean
'determine if the current user can open the page with the given URL
End Function

TIA,

Corno


Nov 19 '05 #3
Yes, I'm using Windows ACL. The webserver runs in an active directory and in
the web.config of the pages I've configured access rights.
How would I do it in that case?

TIA,

Corno

"Joe Kaplan (MVP - ADSI)" <jo************ *@removethis.ac centure.com> wrote
in message news:e4******** ********@TK2MSF TNGP14.phx.gbl. ..
It depends a great deal on how the authorization is being done. Are you
using Windows ACLs or a custom role-based mechanism or something else?

Joe K.

"Corno" <Corno@dds%FAKE %.nl> wrote in message
news:eN******** *****@TK2MSFTNG P10.phx.gbl...
Hi all,

How do I find out if the current visitor of my page has enough rights to
open another page on the same server?
I need this to show a link to that page only when the visitor can
actually visit that page and will not get an 'access denied' message.

IOW, I'm looking for the implementation of the following function:

Public Function CurrentUserCanO penPage(ByVal TheURL As String) As Boolean
'determine if the current user can open the page with the given URL
End Function

TIA,

Corno


Nov 19 '05 #4
The only way I know to do this correctly is to use the AccessCheck Windows
API function via pinvoke. It is a bit of a pain to set it up, but it should
give you the most reliable results.

The other thing you might do is simply impersonate the user and try to
access the file via a System.IO class, catching the exception if it occurs.
That is less elegant and possibly slower, but probably a lot easier to
implement.

Joe K.
"Corno" <Corno@dds%FAKE %.nl> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Yes, I'm using Windows ACL. The webserver runs in an active directory and
in the web.config of the pages I've configured access rights.
How would I do it in that case?

TIA,

Corno

"Joe Kaplan (MVP - ADSI)" <jo************ *@removethis.ac centure.com> wrote
in message news:e4******** ********@TK2MSF TNGP14.phx.gbl. ..
It depends a great deal on how the authorization is being done. Are you
using Windows ACLs or a custom role-based mechanism or something else?

Joe K.

"Corno" <Corno@dds%FAKE %.nl> wrote in message
news:eN******** *****@TK2MSFTNG P10.phx.gbl...
Hi all,

How do I find out if the current visitor of my page has enough rights to
open another page on the same server?
I need this to show a link to that page only when the visitor can
actually visit that page and will not get an 'access denied' message.

IOW, I'm looking for the implementation of the following function:

Public Function CurrentUserCanO penPage(ByVal TheURL As String) As
Boolean
'determine if the current user can open the page with the given URL
End Function

TIA,

Corno



Nov 19 '05 #5

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

Similar topics

10
3184
by: Alphonse Giambrone | last post by:
I have a web form with 2 user controls on it (UC1 and UC2). Each control has a bound datagrid with textboxes in the footer to add a new row. There are also requiredfieldvalidators in each footer. When I try to add a new row to UC1 the requiredfieldvalidators for UC2 fire and therefore the page is not posted. If I remove one control, everything works fine. I have 2 questions. 1. How can I get the validators for each control to only...
8
6906
by: A.M | last post by:
Hi, I know that i can use Page.Request.Path to find what is the current page name. The problem is I can't access to Page object inside a user control. Is there any way that a user control access to the page class? Thanks Ali
3
3272
by: feng | last post by:
In my ASP.Net app I have a aspx page that's called by an other page's client side JavaScript code. The problem is that the first time this page get loaded, it will be cached in the user's local cache and will not be refreshed in the following calls. I checked the following calls and I see that even the page's Page_Load method of the codebehind will not be invoked. I also checked that if I clear the browser's cache each time the page...
4
2518
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once I have exposed a public property containing the value of a textbox in a user control..how do I grab this from the calling page? I cant think of the syntax, since my page doesnt know the contents of the class (and therefore, the public...
24
1922
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce deployment my app is 427KB (even with modem dialup speed it doesn't take long to download) -- the user gets a very friendly secure WindowsForm app (most of them don't even notice they're not under IE anymore) that performs considerably faster than...
3
1541
by: Jonnie | last post by:
I want to build a secure user authentication page that uses mySQL to verify user, password, and access rights, where admins see everything and full acess, while others see only links and pages their 'group' has access to. I am pretty new to PHP and this will be a great learning project, so any guidance on where to start would be welcome. I am looking at a few tutoriqals now, but most of them seem to focus on protecting a whole site or...
12
4771
by: davids58 | last post by:
trying to figure out how to use a mysql database with PHP. I ran the following code: <?php // defines database connection data define('DB_HOST', 'localhost'); define('DB_USER', 'ajaxuser'); define('DB_PASSWORD', 'practical'); define('DB_DATABASE', 'ajax'); // connect to the database $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
17
3923
by: teddysnips | last post by:
One of my clients has asked me to make a change to one of their Access applications. The application is a Front End/Back End standard app. I didn't develop it, but looking at it tells me that it was done entirely using the Wizards. There is no log-in procedure. They want to amend it so that only one person can be logged in at any one time. So, if Joe Bloggs tries to open the application, and Fred Jones has already connected, Joe...
3
4429
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On the other machine I get the error upon instantiating the service client. I add the reference by choosing Add Service Reference from the project menu, and pointing to the remote wsdl file. I can't seem to find what the difference between the two...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9050
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6785
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4115
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 we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.