473,327 Members | 2,118 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,327 software developers and data experts.

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 CurrentUserCanOpenPage(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 1351
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*************@TK2MSFTNGP10.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 CurrentUserCanOpenPage(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.accenture.com> wrote
in message news:e4****************@TK2MSFTNGP14.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*************@TK2MSFTNGP10.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 CurrentUserCanOpenPage(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.accenture.com> wrote
in message news:e4****************@TK2MSFTNGP14.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*************@TK2MSFTNGP10.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 CurrentUserCanOpenPage(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****************@TK2MSFTNGP09.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.accenture.com> wrote
in message news:e4****************@TK2MSFTNGP14.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*************@TK2MSFTNGP10.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 CurrentUserCanOpenPage(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
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....
8
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...
3
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...
4
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...
24
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...
3
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...
12
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');...
17
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...
3
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.