Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

RegistryPermission, custom trust policy, etc

  Asked By: Grant    Date: May 09    Category: Sharepoint    Views: 958

I have a web part that will work just fine if I toss it in full trust mode, but that's not what I want... This web part writes two values to the server registry when a specific command is entered in a text box. What I need is for it to be able to write to the registry. So instead of adding my WP assembly to my custom policy file under the permission set FullTrust I created my own permission set:

<PermissionSet Name="AddUserSecurityWp"
class="NamedPermissionSet" version="1"
Description="Allows full access to resources
required for custom navigation">
<IPermission class="AspNetHostingPermission"
version="1" Level="Medium" />
<IPermission class="DnsPermission" version="1"
Unrestricted="true" />
<IPermission
class="IsolatedStorageFilePermission" version="1"
Allowed="AssemblyIsolationByUser" UserQuota="9223372036854775807" />
<IPermission class="SecurityPermission"
version="1" Flags="Assertion, Execution, ControlThread, ControlPrincipal,
RemotingConfiguration" />
<IPermission class="SharePointPermission"
version="1" ObjectModel="True" />
<IPermission class="RegistryPermission"
version="1" Unrestricted="True" />
</PermissionSet>

And then I specified it in the code groups:
<CodeGroup PermissionSetName="AddUserSecurityWp"
class="UnionCodeGroup" version="1">
<IMembershipCondition
class="StrongNameMembershipCondition" Name="AddReaderUserWP.dll"
version="1.0.0.1" PublicKeyBlob="[omitted for brevity]" />
</CodeGroup>
However, even after an IIS reset, I still get the following when I try to run the code that writes to the registry:

Request for the permission of type System.Security.Permissions.RegistryPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Ideas?

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Gopal Jamakhandi     Answered On: Feb 26

You can create new top-level sites through SharePoint Central Administration,
but they would all still be under the root. How about creating a new IIS
virtual server  and then extending it with WSS?

 
Answer #2    Answered By: Ana Payne     Answered On: Feb 26

Would this require me to implement a header host name and/or separate IP
address? (i.e. http://Server2name/...) I thought about doing this before,
but don't quite understand all of the process yet.

Does this provide a second WSS installation somewhere? Where would the root
of that be?

I can see that my test server  is going to bite the dust this weekend.

 
Answer #3    Answered By: Laura Walker     Answered On: Feb 26

Get yourself a copy of Virtual server  and create some Virtual Machines. Then recovery from biting the dust means copying a 2GB file  not rebuilding a server.

 
Didn't find what you were looking for? Find more on RegistryPermission, custom trust policy, etc Or get search suggestion and latest updates.