[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

PrincipalPermissionAttribute for WCF Method?

coconet

10/9/2008 1:53:00 PM


I have this in my code in a WCF receiver method:



// WCF client WinForm has already created a MyCustPrincipal and
assigned it to the current thread Principal before making that WCF
call to this service.

public int dowork( MyCustPrincipal custPrin , List<WorkThings>
workThing )
{
Thread.CurrentPrincipal = custPrin;
PrincipalPermission perm = new PrincipalPermission( null , "Users" ,
true );
perm.Demand();
// do work
}

I would like to change this to a standard PrincipalPermissionAttribute
on the method, but I don't understand what to configure to make that
happen. Is there a web.config change needed?

Thanks.
6 Answers

Alvin Bruney [ASP.NET MVP]

10/10/2008 12:40:00 AM

0

No, the code is imperative so you just add the permissions in code.
configuration editing is declarative, not needed here.

--
Regards,
Alvin Bruney

Want a free copy of VS 2008 w/ MSDN premium subscription?
Details at http://msmvps.com/blogs/alvin/De...

Auther Plug
OWC Blackbook now on download at www.lulu.com/owc

"Co Co Net" <coconet@community.nospam> wrote in message
news:263se4lsl4k4brk74k6v5d6qj8vrl8a5bn@4ax.com...
>
> I have this in my code in a WCF receiver method:
>
>
>
> // WCF client WinForm has already created a MyCustPrincipal and
> assigned it to the current thread Principal before making that WCF
> call to this service.
>
> public int dowork( MyCustPrincipal custPrin , List<WorkThings>
> workThing )
> {
> Thread.CurrentPrincipal = custPrin;
> PrincipalPermission perm = new PrincipalPermission( null , "Users" ,
> true );
> perm.Demand();
> // do work
> }
>
> I would like to change this to a standard PrincipalPermissionAttribute
> on the method, but I don't understand what to configure to make that
> happen. Is there a web.config change needed?
>
> Thanks.

Victallen

1/18/2010 11:20:00 AM

0

R?jeanne Tremblay wrote:
> On 17 jan, 11:54, "Victal" <Victal...@sympatico.qc.ca> wrote:
>> sas wrote:
>>> Coudonc ca demeure ou ce Victal? Jai des fleurs a lui livrer!
>>
>> vous signerez votre nom ainsi que celui de l'envoyeur j"esp?re
>
>
> R?jeanne tremblay ...bonne chance !


La chance est la religion des faibles

A.G.


C 'est toujours la v?rit? qu'on insulte et qu'on menace et c'est toujours la
b?tise qui se terre et qui grimace


A.G.


Réjeanne Tremblay

1/18/2010 3:09:00 PM

0

On 18 jan, 06:20, "Victal" <Victal...@sympatico.qc.ca> wrote:
> Réjeanne Tremblay wrote:
> > On 17 jan, 11:54, "Victal" <Victal...@sympatico.qc.ca> wrote:
> >> sas wrote:
> >>> Coudonc ca demeure ou ce Victal? Jai des fleurs a lui livrer!
>
> >> vous signerez votre nom ainsi que celui de l'envoyeur j"espère
>
> > Réjeanne tremblay  ...bonne chance !
>
> La chance est la religion des faibles
>
> A.G.
>
> C 'est toujours la vérité qu'on insulte et qu'on menace et c'est toujours la
> bêtise qui se terre et qui grimace
>
> A.G.

Toujours aussi parano, je veux dire bonne chance si tu veux me
retrouver

--
Réjeanne

Malachite

1/18/2010 11:35:00 PM

0

Victal a ?crit :
> R?jeanne Tremblay wrote:
>> On 17 jan, 11:54, "Victal" <Victal...@sympatico.qc.ca> wrote:
>>> sas wrote:
>>>> Coudonc ca demeure ou ce Victal? Jai des fleurs a lui livrer!
>>> vous signerez votre nom ainsi que celui de l'envoyeur j"esp?re
>>
>> R?jeanne tremblay ...bonne chance !
>
>
> La chance est la religion des faibles
>
Moi qui croyais que les religions avaient comme vocation d'aider les
plus faibles.

Anne G

1/18/2010 11:43:00 PM

0

Le 1/18/10 4:34 PM, Malachite a ?crit :
> Victal a ?crit :

>> La chance est la religion des faibles

> Moi qui croyais que les religions avaient comme vocation d'aider les
> plus faibles.

Comme son vocabulaire, la religion de victal est particuli?re.

Il interpr?te la religion catholique dans son int?r?t.
Son ?glise, et ses ?fr?res? les CdeC, est en fait une agence
d'assurance, dont le but est de faire du fric sans payer d'imp?ts.

Malachite

1/19/2010 3:33:00 AM

0

Anne G a ?crit :
> Le 1/18/10 4:34 PM, Malachite a ?crit :
>> Victal a ?crit :
>
>>> La chance est la religion des faibles
>
>> Moi qui croyais que les religions avaient comme vocation d'aider les
>> plus faibles.
>
> Comme son vocabulaire, la religion de victal est particuli?re.
>
> Il interpr?te la religion catholique dans son int?r?t.
> Son ?glise, et ses ?fr?res? les CdeC, est en fait une agence
> d'assurance, dont le but est de faire du fric sans payer d'imp?ts.

Je ne sais pas si on doit applaudir ou huer, vu qu'il discr?dite la
religion catholique ? son insu.