473,657 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GenericPrincipa l & Impersonation

I am working on a web based application in which all "roles" are stored in
the database. When a user logs in their roles are then transferred to a
comma delemited string, saved to a cookie, etc...

On one method I have the following
<PrincipalPermi ssion(SecurityA ction.Demand, Authenticated:= True,
Role:="managePr ospects")> _
Public Sub Add(prospect As MarketingProspe ct)

In rare cases we have found there my be an issue adding data so we have
built a check that if data does not exist to add the default values for the
corresponding database table. Being that in 99.9% of the cases users must be
authenticated and be in the manageProspects role. Below is how we populate
the class and the data when a rare event occurs.

If dt.Rows.Count = 0 Then
Dim trk As New Tracking(Nothin g, Nothing, Nothing, Nothing, Nothing,
StatusType.Stat usTypes.Prospec t)
trk.Add(prospec t)
Return trk
Else......

Can I impersonate the manageProspects role when I call trk.Add(prospec t)
above? This way the Declarative checks will not apply if the user does not
have permission in this case. This would be the only situation in which they
would need permission granted to them and for only this one call.

Thanks for any help...
Jun 29 '06 #1
0 1146

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

Similar topics

12
2562
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The problem is that even when it is configured to run under a certain identity through Web.config, the impersonation is not carried through to COM library. Consequently, the code in COM object runs under a local account and any code that needs to access...
0
1578
by: matthew | last post by:
I am trying to create an Outlook application object in my asp.net page, but i get a message saying it could not create instance of server. The Event log tells me that 'The server {xxx-xxx-xxx} did not register with DCOM within the required timeout.' Surely this should not be difficult? i am using impersonation to get the identity i want (it doesn't work without impersonation either). If it's a permission issue can someone tell me how i...
4
1624
by: TipTop | last post by:
I am trying to use integrated Windows authentication and impersonation to run a page that accesses SQL Server via integrated security. It's not working -- sort of. I've set IIS security to integrated Windows authentication (and unchecked the other options). I've set the web.config to use Windows authentication and set impersonation to true. The connection string includes Integrated Security = SSPI. And it works... if you access the...
2
3246
by: Matthew Lee | last post by:
I am using a C# / ASP.NET application to fire an XCOPY job from the webserver to a UNC share. This setup works fine when copying to a local machine but refuses to work on the remote copy. The process executes correctly, but XCOPY returns "invalid drive specification", which I'm guessing actually means that the current user context (ASP.NET application) can't access the share (e.g. \\someserver\c$\mydir\) Anyway, here's where I'm at...
2
1523
by: Olivier Matrot | last post by:
I need to impersonate in ASP.NET in order to print a document to a printer. The guidelines in http://support.microsoft.com/kb/306158/EN-US/ do not tell about loading the user profile (LoadUserProfile). Where should this call be inserted ? TIA.
4
1077
by: Jason James | last post by:
Hi all, I am developing an ASP.NET app that will be deployed into a mixed NT4 & W2K domain. The PDC is running NT4 (I know we should have upgraded by now and it is on the cards but this is what I have to work with). On my development machine I have an ASPNET user that I assume is my annonymous user, but this user is not present in the domain! Do I need an ASPNET user
3
3034
by: Harold Crump | last post by:
Greetings, I need to implement GenericPrincipal based authentication without using ASP.NET Forms Authentication. I know it is much simpler using Forms Authentication, but in this case, I have no control over the matter. I have two pages - login.aspx and home.aspx. Following is the Click event of the login button on the login.aspx page
2
1374
by: Joyce | last post by:
Hi, Can I return GenericPrincipal from Web Services? The following error displays when I try to return GenericPrincipal from Web Services. System.Security.Principal.GenericPrincipal cannot be serialized because it does not have a default public constructor. Thanks.
1
1877
by: Patrick | last post by:
I have an ASP.NET web service whose Web.Config is set to use impersonation <authentication mode="Windows" /> <identity impersonate="true" /> Within a Web Method, I want to use Multi-threading to spawn off an asynchronous process, as it takes quite long to return. How could I get the worker thread to runas the same impersonated user on ASP.NET?
1
3911
by: DotNetNewbie | last post by:
Hi, When adding roles to the GenericPrincipal, is this a per request object or is it in session? In my global.asax.cs , which event should I be adding the roles to the GenericPrincipal?
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
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
8503
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
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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
5632
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
4151
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...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.