Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create a custom code group

0 views
Skip to first unread message

ALI-R

unread,
Nov 9, 2004, 2:18:54 PM11/9/04
to
Hi,
I want to take these steps in my application :

1) Create a custom code group that has that strong name of an specific
assemly( which I know which assembly is that) as a membership condition.

2) Assign the code group a permission set that has only the permissions that
the assembly needs to run and no more.


which namespace I should use and how?

thanks for your help


Rob Teixeira

unread,
Nov 9, 2004, 4:36:00 PM11/9/04
to
See my reply to your first post

-Rob Teixeira

"ALI-R" <a...@microsoft.com> wrote in message
news:%233yReFp...@TK2MSFTNGP10.phx.gbl...

Eugene V. Bobukh [MS]

unread,
Nov 9, 2004, 4:47:40 PM11/9/04
to
System.Security
System.Security.Policy
System.Security.Permissions

Note however that most of that functionality is available in FullTrust only, and thus cannot be used by default by Internet/Intranet applications.

--

Eugene V. Bobukh

This message is provided "AS IS" with no warranties, and confers no rights. Any opinions or policies stated within it are my own and do not necessarily constitute those of my employer.

----

"ALI-R" <a...@microsoft.com> wrote in message news:%233yReFp...@TK2MSFTNGP10.phx.gbl...

Nicole Calinoiu

unread,
Nov 10, 2004, 7:01:58 AM11/10/04
to
If you wish to restrict the permissions granted to your assembly to a subset
of those permitted by policy, there is no need to modify the policy.
Instead, you can use CAS permission request attributes in your assembly's
code to specify the maximum permission set with which your assembly should
run. To do this, start by adding the following request (C# format):

[assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted =
false)]

The above will cause your assembly to be denied permissions it does not
explicitly request. Once you've added this, your assembly will only have
SecurityPermission.Execution permission and any identity permissions mapped
from its evidence, so you'll need to add minimum (or optional, if
appropriate) requests for any additional permissions your assembly needs.
For example, if the assembly needs unrestricted UIPermission, you would add
the following:

[assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted = true)]

For more information on how assembly-level CAS permission attributes work,
see http://blogs.msdn.com/shawnfa/archive/2004/08/30/222918.aspx.

HTH,
Nicole

"ALI-R" <a...@microsoft.com> wrote in message
news:%233yReFp...@TK2MSFTNGP10.phx.gbl...

ALI-R

unread,
Nov 12, 2004, 2:57:34 PM11/12/04
to
Thanks Niocle,your answers are always helpful and detailed.

ALI
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:%23uqzw6x...@TK2MSFTNGP14.phx.gbl...

0 new messages