Home All Groups Group Topic Archive Search About

Loading permission sets

Author
27 Jun 2006 1:12 AM
John Wood
Hi all,

Is there any way to load a System.Security.PermissionSet with all the
permissions that are defined in the runtime security policy for a specific
zone? For example I want to set up an application to simulate running in a
browser, so I want it to be set up with all the permissions defined in the
Internet permission set that you see in the Runtime Security Policy editor.

Any ideas welcome.

John
---
Blog: http://www.dotnetjunkies.com/weblog/johnwood

Author
27 Jun 2006 7:44 AM
Dominick Baier [DevelopMentor]
PermissionSet permissions;

evidence = new Evidence(
                        new object[] { new Zone(SecurityZone.Internet) },
                        new object[] { });

permissions = SecurityManager.ResolvePolicy(evidence);

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Hi all,
>
> Is there any way to load a System.Security.PermissionSet with all the
> permissions that are defined in the runtime security policy for a
> specific zone? For example I want to set up an application to simulate
> running in a browser, so I want it to be set up with all the
> permissions defined in the Internet permission set that you see in the
> Runtime Security Policy editor.
>
> Any ideas welcome.
>
> John
> ---
> Blog: http://www.dotnetjunkies.com/weblog/johnwood
Author
27 Jun 2006 3:14 PM
John Wood
Thanks Dominick.

Once I have the permission set, how would I go about denying all the
permissions that the Internet zone excludes? Performing a Deny on the
permission set you specify below doesn't seem to work for me... using the
overloaded ResolvePolicy that outputs the denied permissionset just raises
an exception 'Execution permission cannot be acquired' - not sure what I'm
doing wrong?

Thanks again.
John

Show quoteHide quote
"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:4580be631a124b8c867e55bb55681@news.microsoft.com...
> PermissionSet permissions;
>
> evidence = new Evidence(
>                        new object[] { new Zone(SecurityZone.Internet) },
>                        new object[] { });
>
> permissions = SecurityManager.ResolvePolicy(evidence);
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> Hi all,
>>
>> Is there any way to load a System.Security.PermissionSet with all the
>> permissions that are defined in the runtime security policy for a
>> specific zone? For example I want to set up an application to simulate
>> running in a browser, so I want it to be set up with all the
>> permissions defined in the Internet permission set that you see in the
>> Runtime Security Policy editor.
>>
>> Any ideas welcome.
>>
>> John
>> ---
>> Blog: http://www.dotnetjunkies.com/weblog/johnwood
>
>