Index: /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/PermissionAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/PermissionAdapter.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/PermissionAdapter.cs	(revision 1724)
@@ -28,4 +28,15 @@
 
         return grantedPermissionsAdapter;
+      }
+    }
+
+    private IUserGroupAdapter userGroupAdapter;
+
+    private IUserGroupAdapter UserGroupAdapter {
+      get {
+        if (userGroupAdapter == null)
+          this.Session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+
+        return userGroupAdapter;
       }
     }
@@ -89,5 +100,19 @@
         return perm;
       } else {
-        return null;
+        ICollection<UserGroup> groups =
+          UserGroupAdapter.MemberOf(permissionId);
+
+        GrantedPermission perm = null;
+
+        if (groups != null) {
+          foreach(UserGroup group in groups) {
+            perm = getPermission(group.Id, permissionId, entityId);
+
+            if (perm != null)
+              break;
+          }
+        }
+
+        return perm;
       }
     }
Index: /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/UserGroupAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/UserGroupAdapter.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/UserGroupAdapter.cs	(revision 1724)
@@ -125,6 +125,10 @@
     }
 
-    public ICollection<UserGroup> MemberOf(PermissionOwner permOwner) {
-      throw new NotImplementedException();
+    public ICollection<UserGroup> MemberOf(Guid permissionOwnerId) {
+      return base.FindMultiple(
+        delegate() {
+          return Adapter.GetDataByMemberOf(permissionOwnerId);
+        }
+      );
     }
 
Index: /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.Designer.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.Designer.cs	(revision 1724)
@@ -3245,5 +3245,5 @@
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         private void InitCommandCollection() {
-            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
             this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
             this._commandCollection[0].Connection = this.Connection;
@@ -3255,4 +3255,11 @@
             this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
             this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT * FROM UserGroup WHERE EXISTS (SELECT * FROM PermissionOwner_UserGroup WHE" +
+                "RE PermissionOwner_UserGroup.PermissionOwnerId = @PermissionOwnerId AND Permissi" +
+                "onOwner_UserGroup.UserGroupId = UserGroup.PermissionOwnerId)";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
         }
         
@@ -3298,4 +3305,28 @@
             this.Adapter.SelectCommand = this.CommandCollection[1];
             this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            dsSecurity.UserGroupDataTable dataTable = new dsSecurity.UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
+        public virtual int FillByMemberOf(dsSecurity.UserGroupDataTable dataTable, System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            if ((this.ClearBeforeFill == true)) {
+                dataTable.Clear();
+            }
+            int returnValue = this.Adapter.Fill(dataTable);
+            return returnValue;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+        public virtual dsSecurity.UserGroupDataTable GetDataByMemberOf(System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
             dsSecurity.UserGroupDataTable dataTable = new dsSecurity.UserGroupDataTable();
             this.Adapter.Fill(dataTable);
Index: /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xsd
===================================================================
--- /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xsd	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xsd	(revision 1724)
@@ -156,4 +156,14 @@
                 </SelectCommand>
               </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByMemberOf" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByMemberOf" GeneratorSourceName="FillByMemberOf" GetMethodModifier="Public" GetMethodName="GetDataByMemberOf" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByMemberOf" UserSourceName="FillByMemberOf">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM UserGroup WHERE EXISTS (SELECT * FROM PermissionOwner_UserGroup WHERE PermissionOwner_UserGroup.PermissionOwnerId = @PermissionOwnerId AND PermissionOwner_UserGroup.UserGroupId = UserGroup.PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.UserGroup" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
             </Sources>
           </TableAdapter>
@@ -442,7 +452,7 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionId" msprop:Generator_ColumnVarNameInTable="columnPermissionId" msprop:Generator_ColumnPropNameInRow="PermissionId" msprop:Generator_ColumnPropNameInTable="PermissionIdColumn" type="xs:string" />
-              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
-              <xs:element name="EntityId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="EntityId" msprop:Generator_ColumnVarNameInTable="columnEntityId" msprop:Generator_ColumnPropNameInRow="EntityId" msprop:Generator_ColumnPropNameInTable="EntityIdColumn" type="xs:string" />
+              <xs:element name="PermissionId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionId" msprop:Generator_ColumnPropNameInRow="PermissionId" msprop:Generator_ColumnVarNameInTable="columnPermissionId" msprop:Generator_ColumnPropNameInTable="PermissionIdColumn" type="xs:string" />
+              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+              <xs:element name="EntityId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="EntityId" msprop:Generator_ColumnPropNameInRow="EntityId" msprop:Generator_ColumnVarNameInTable="columnEntityId" msprop:Generator_ColumnPropNameInTable="EntityIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
@@ -451,5 +461,5 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
@@ -458,20 +468,20 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
-              <xs:element name="Password" msprop:Generator_UserColumnName="Password" msprop:Generator_ColumnPropNameInRow="Password" msprop:Generator_ColumnVarNameInTable="columnPassword" msprop:Generator_ColumnPropNameInTable="PasswordColumn" minOccurs="0">
-                <xs:simpleType>
-                  <xs:restriction base="xs:string">
-                    <xs:maxLength value="2147483647" />
-                  </xs:restriction>
-                </xs:simpleType>
-              </xs:element>
-              <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInTable="LoginColumn" minOccurs="0">
-                <xs:simpleType>
-                  <xs:restriction base="xs:string">
-                    <xs:maxLength value="2147483647" />
-                  </xs:restriction>
-                </xs:simpleType>
-              </xs:element>
-              <xs:element name="MailAddress" msprop:Generator_UserColumnName="MailAddress" msprop:Generator_ColumnPropNameInRow="MailAddress" msprop:Generator_ColumnVarNameInTable="columnMailAddress" msprop:Generator_ColumnPropNameInTable="MailAddressColumn" minOccurs="0">
+              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+              <xs:element name="Password" msprop:Generator_UserColumnName="Password" msprop:Generator_ColumnVarNameInTable="columnPassword" msprop:Generator_ColumnPropNameInRow="Password" msprop:Generator_ColumnPropNameInTable="PasswordColumn" minOccurs="0">
+                <xs:simpleType>
+                  <xs:restriction base="xs:string">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+              <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnPropNameInTable="LoginColumn" minOccurs="0">
+                <xs:simpleType>
+                  <xs:restriction base="xs:string">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+              <xs:element name="MailAddress" msprop:Generator_UserColumnName="MailAddress" msprop:Generator_ColumnVarNameInTable="columnMailAddress" msprop:Generator_ColumnPropNameInRow="MailAddress" msprop:Generator_ColumnPropNameInTable="MailAddressColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -486,20 +496,20 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionId" msprop:Generator_ColumnVarNameInTable="columnPermissionId" msprop:Generator_ColumnPropNameInRow="PermissionId" msprop:Generator_ColumnPropNameInTable="PermissionIdColumn" type="xs:string" />
-              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
-                <xs:simpleType>
-                  <xs:restriction base="xs:string">
-                    <xs:maxLength value="2147483647" />
-                  </xs:restriction>
-                </xs:simpleType>
-              </xs:element>
-              <xs:element name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" minOccurs="0">
-                <xs:simpleType>
-                  <xs:restriction base="xs:string">
-                    <xs:maxLength value="2147483647" />
-                  </xs:restriction>
-                </xs:simpleType>
-              </xs:element>
-              <xs:element name="Plugin" msprop:Generator_UserColumnName="Plugin" msprop:Generator_ColumnPropNameInRow="Plugin" msprop:Generator_ColumnVarNameInTable="columnPlugin" msprop:Generator_ColumnPropNameInTable="PluginColumn" minOccurs="0">
+              <xs:element name="PermissionId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionId" msprop:Generator_ColumnPropNameInRow="PermissionId" msprop:Generator_ColumnVarNameInTable="columnPermissionId" msprop:Generator_ColumnPropNameInTable="PermissionIdColumn" type="xs:string" />
+              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
+                <xs:simpleType>
+                  <xs:restriction base="xs:string">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+              <xs:element name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" minOccurs="0">
+                <xs:simpleType>
+                  <xs:restriction base="xs:string">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+              <xs:element name="Plugin" msprop:Generator_UserColumnName="Plugin" msprop:Generator_ColumnVarNameInTable="columnPlugin" msprop:Generator_ColumnPropNameInRow="Plugin" msprop:Generator_ColumnPropNameInTable="PluginColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -514,6 +524,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
-              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
+              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
                 <xs:simpleType>
                   <xs:restriction base="xs:string">
@@ -528,6 +538,6 @@
           <xs:complexType>
             <xs:sequence>
-              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
-              <xs:element name="UserGroupId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="UserGroupId" msprop:Generator_ColumnVarNameInTable="columnUserGroupId" msprop:Generator_ColumnPropNameInRow="UserGroupId" msprop:Generator_ColumnPropNameInTable="UserGroupIdColumn" type="xs:string" />
+              <xs:element name="PermissionOwnerId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+              <xs:element name="UserGroupId" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="UserGroupId" msprop:Generator_ColumnPropNameInRow="UserGroupId" msprop:Generator_ColumnVarNameInTable="columnUserGroupId" msprop:Generator_ColumnPropNameInTable="UserGroupIdColumn" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
Index: /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xss
===================================================================
--- /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xss	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/dsSecurity.xss	(revision 1724)
@@ -5,8 +5,8 @@
      the code is regenerated.
 </autogenerated>-->
-<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="231" ViewPortY="48" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
+<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="306" ViewPortY="51" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
   <Shapes>
     <Shape ID="DesignTable:GrantedPermissions" ZOrder="9" X="241" Y="438" Height="190" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="75" />
-    <Shape ID="DesignTable:UserGroup" ZOrder="8" X="946" Y="238" Height="106" Width="202" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
+    <Shape ID="DesignTable:UserGroup" ZOrder="8" X="946" Y="238" Height="123" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
     <Shape ID="DesignTable:HLUser" ZOrder="2" X="577" Y="484" Height="156" Width="182" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="92" />
     <Shape ID="DesignTable:Permission" ZOrder="3" X="292" Y="192" Height="156" Width="204" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="92" />
@@ -91,5 +91,5 @@
         <Point>
           <X>1024</X>
-          <Y>344</Y>
+          <Y>361</Y>
         </Point>
         <Point>
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/HeuristicLab.Security.Core-3.2.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/HeuristicLab.Security.Core-3.2.csproj	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/HeuristicLab.Security.Core-3.2.csproj	(revision 1724)
@@ -52,4 +52,10 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SecurityManager.cs" />
+    <Compile Include="ServiceLocator.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
@@ -72,6 +78,11 @@
   </ItemGroup>
   <ItemGroup>
+    <None Include="app.config" />
     <None Include="HeuristicLab.snk" />
     <None Include="Properties\AssemblyInfo.frame" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/PermissionManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/PermissionManager.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/PermissionManager.cs	(revision 1724)
@@ -12,5 +12,5 @@
   public class PermissionManager : IPermissionManager{
 
-    private static ISessionFactory factory = (new DiscoveryService()).GetInstances<ISessionFactory>()[0];
+    private static ISessionFactory factory = ServiceLocator.GetSessionFactory();
 
     private static ISession session;
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.Designer.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.Designer.cs	(revision 1724)
@@ -0,0 +1,36 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3082
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Security.Core.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security In" +
+            "fo=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true")]
+        public string SecurityServerConnectionString {
+            get {
+                return ((string)(this["SecurityServerConnectionString"]));
+            }
+        }
+    }
+}
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.settings
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.settings	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/Properties/Settings.settings	(revision 1724)
@@ -0,0 +1,9 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Security.Core.Properties" GeneratedClassName="Settings1">
+  <Profiles />
+  <Settings>
+    <Setting Name="SecurityServerConnectionString" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security Info=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/SecurityManager.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/SecurityManager.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/SecurityManager.cs	(revision 1724)
@@ -12,5 +12,5 @@
   public class SecurityManager : ISecurityManager {
 
-    private static ISessionFactory factory = (new DiscoveryService()).GetInstances<ISessionFactory>()[0];
+    private static ISessionFactory factory = ServiceLocator.GetSessionFactory();
 
     private ISession session;
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/ServiceLocator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/ServiceLocator.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/ServiceLocator.cs	(revision 1724)
@@ -0,0 +1,37 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.DataAccess.Interfaces;
+using System.Runtime.CompilerServices;
+using System.Data.SqlClient;
+
+namespace HeuristicLab.Security.Core {
+  class ServiceLocator {
+    private static DiscoveryService discoveryService =
+      new DiscoveryService();
+
+    private static ISessionFactory sessionFactory = null;
+
+    /// <summary>
+    /// Gets the db session factory
+    /// </summary>
+    /// <returns></returns>
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public static ISessionFactory GetSessionFactory() {
+      if (sessionFactory == null) {
+        sessionFactory =
+          discoveryService.GetInstances<ISessionFactory>()[0];
+
+        sessionFactory.DbConnectionType =
+          typeof(SqlConnection);
+
+        sessionFactory.DbConnectionString =
+          HeuristicLab.Security.Core.Properties.Settings.Default.SecurityServerConnectionString;
+      }
+
+      return sessionFactory;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Security.Core/3.2/app.config
===================================================================
--- /trunk/sources/HeuristicLab.Security.Core/3.2/app.config	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Core/3.2/app.config	(revision 1724)
@@ -0,0 +1,15 @@
+﻿<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="HeuristicLab.Security.Core.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <applicationSettings>
+        <HeuristicLab.Security.Core.Properties.Settings1>
+            <setting name="SecurityServerConnectionString" serializeAs="String">
+                <value>Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security Info=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true</value>
+            </setting>
+        </HeuristicLab.Security.Core.Properties.Settings1>
+    </applicationSettings>
+</configuration>
Index: /trunk/sources/HeuristicLab.Security.DataAccess/3.2/IUserGroupAdapter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.DataAccess/3.2/IUserGroupAdapter.cs	(revision 1723)
+++ /trunk/sources/HeuristicLab.Security.DataAccess/3.2/IUserGroupAdapter.cs	(revision 1724)
@@ -43,5 +43,5 @@
     /// <param name="permOwner"></param>
     /// <returns></returns>
-    ICollection<UserGroup> MemberOf(PermissionOwner permOwner);
+    ICollection<UserGroup> MemberOf(Guid permissionOwnerId);
   }
 }
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/HeuristicLab.Security.Server-3.2.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/HeuristicLab.Security.Server-3.2.csproj	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/HeuristicLab.Security.Server-3.2.csproj	(revision 1724)
@@ -0,0 +1,100 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E3288D4B-7A51-499A-AC5B-019319CE51DC}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Security.Server</RootNamespace>
+    <AssemblyName>HeuristicLab.Security.Server-3.2</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SecurityServer.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="SecurityServer.Designer.cs">
+      <DependentUpon>SecurityServer.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SecurityServerApplication.cs" />
+    <Compile Include="SecurityServerPlugin.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Security.Contracts\3.2\HeuristicLab.Security.Contracts-3.2.csproj">
+      <Project>{D59E852C-F205-4647-8C05-EB9ED1CF44E9}</Project>
+      <Name>HeuristicLab.Security.Contracts-3.2</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="SecurityServer.resx">
+      <DependentUpon>SecurityServer.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/Properties/AssemblyInfo.frame
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/Properties/AssemblyInfo.frame	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/Properties/AssemblyInfo.frame	(revision 1724)
@@ -0,0 +1,59 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using HeuristicLab.PluginInfrastructure;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Security.Server")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2008 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8FBBDB13-2B7A-46b3-8DF8-517CAE76E79A")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyFileVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyBuildDate("$WCNOW$")]
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.Designer.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.Designer.cs	(revision 1724)
@@ -0,0 +1,93 @@
+﻿namespace HeuristicLab.Security.Server {
+  partial class SecurityServer {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.label1 = new System.Windows.Forms.Label();
+      this.labelPermission = new System.Windows.Forms.Label();
+      this.label3 = new System.Windows.Forms.Label();
+      this.labelSecurity = new System.Windows.Forms.Label();
+      this.SuspendLayout();
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+      this.label1.Location = new System.Drawing.Point(26, 31);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(257, 13);
+      this.label1.TabIndex = 0;
+      this.label1.Text = "Security Server Permission Manager running";
+      // 
+      // labelPermission
+      // 
+      this.labelPermission.AutoSize = true;
+      this.labelPermission.Location = new System.Drawing.Point(29, 60);
+      this.labelPermission.Name = "labelPermission";
+      this.labelPermission.Size = new System.Drawing.Size(35, 13);
+      this.labelPermission.TabIndex = 1;
+      this.labelPermission.Text = "label2";
+      // 
+      // label3
+      // 
+      this.label3.AutoSize = true;
+      this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+      this.label3.Location = new System.Drawing.Point(29, 94);
+      this.label3.Name = "label3";
+      this.label3.Size = new System.Drawing.Size(243, 13);
+      this.label3.TabIndex = 2;
+      this.label3.Text = "Security Server Security Manager running";
+      // 
+      // labelSecurity
+      // 
+      this.labelSecurity.AutoSize = true;
+      this.labelSecurity.Location = new System.Drawing.Point(32, 128);
+      this.labelSecurity.Name = "labelSecurity";
+      this.labelSecurity.Size = new System.Drawing.Size(35, 13);
+      this.labelSecurity.TabIndex = 3;
+      this.labelSecurity.Text = "label4";
+      // 
+      // SecurityServer
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(345, 167);
+      this.Controls.Add(this.labelSecurity);
+      this.Controls.Add(this.label3);
+      this.Controls.Add(this.labelPermission);
+      this.Controls.Add(this.label1);
+      this.Name = "SecurityServer";
+      this.Text = "SecurityServer";
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label label1;
+    private System.Windows.Forms.Label labelPermission;
+    private System.Windows.Forms.Label label3;
+    private System.Windows.Forms.Label labelSecurity;
+  }
+}
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.cs	(revision 1724)
@@ -0,0 +1,23 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Security.Server {
+  public partial class SecurityServer : Form {
+    public SecurityServer(Dictionary<string, Uri> baseAddrDict) {
+      InitializeComponent();
+      Uri uri;
+      baseAddrDict.TryGetValue(SecurityServerApplication.STR_PermissionManager, out uri);
+      if (uri != null)
+        this.labelPermission.Text = uri.ToString();
+      baseAddrDict.TryGetValue(SecurityServerApplication.STR_SecurityManager, out uri);
+      if (uri != null)
+        this.labelSecurity.Text = uri.ToString();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.resx
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.resx	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServer.resx	(revision 1724)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerApplication.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerApplication.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerApplication.cs	(revision 1724)
@@ -0,0 +1,126 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.PluginInfrastructure;
+using System.Text;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using System.Net;
+using HeuristicLab.Security.Contracts.Interfaces;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Security.Server {
+
+  [ClassInfo(Name = "Security Server",
+  Description = "Server application for the security.",
+  AutoRestart = true)]
+  public class SecurityServerApplication : ApplicationBase {
+    public const string STR_PermissionManager = "PermissionManager";
+    public const string STR_SecurityManager = "SecurityManager";   
+
+    int DEFAULT_PORT_SM = 9111;
+    int DEFAULT_PORT_PM = 9112;
+
+    private DiscoveryService discService = new DiscoveryService();
+    private Dictionary<string, ServiceHost> runningServices = new Dictionary<string, ServiceHost>();
+    private NetTcpBinding binding = new NetTcpBinding(SecurityMode.None, true);
+
+    private enum Services {
+      SecurityManager,
+      PermissionManager,
+      All
+    }
+    
+    private bool AddMexEndpoint(ServiceHost serviceHost) {
+      if (serviceHost != null) {
+        ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();
+        serviceHost.Description.Behaviors.Add(behavior);
+
+        return serviceHost.AddServiceEndpoint(
+          typeof(IMetadataExchange),
+          MetadataExchangeBindings.CreateMexTcpBinding(),
+          "mex") != null;
+      } else
+        return false;
+    }
+
+    private Uri StartService(Services svc, IPAddress ipAddress, int port) {
+      string curServiceHost = "";
+      Uri uriTcp;
+      ISecurityManager[] securityManagerInstances = discService.GetInstances<ISecurityManager>();
+      IPermissionManager[] permissionManagerInstances = discService.GetInstances<IPermissionManager>();
+      ServiceHost serviceHost = null;
+      switch (svc) {
+        case Services.PermissionManager:
+          if (securityManagerInstances.Length > 0) {
+            uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/PermissionManager/"); 
+            serviceHost = new ServiceHost(permissionManagerInstances[0].GetType(), uriTcp);
+            serviceHost.AddServiceEndpoint(typeof(IPermissionManager), binding, STR_PermissionManager);
+            curServiceHost = STR_PermissionManager;
+          }
+          break;
+        case Services.SecurityManager:
+          if (securityManagerInstances.Length > 0) {
+            uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityManager/");
+            serviceHost = new ServiceHost(securityManagerInstances[0].GetType(), uriTcp);
+            serviceHost.AddServiceEndpoint(typeof(ISecurityManager), binding, STR_SecurityManager);
+            curServiceHost = STR_SecurityManager;
+          }
+          break;
+        case Services.All:
+          throw new InvalidOperationException("Not supported!");
+        default:
+          return null;
+      }
+      if ((serviceHost != null) && (!String.IsNullOrEmpty(curServiceHost))) {
+        AddMexEndpoint(serviceHost);
+    //    WcfSettings.SetServiceCertificate(serviceHost);
+        serviceHost.Open();
+        runningServices.Add(curServiceHost, serviceHost);
+        return serviceHost.BaseAddresses[0];
+      } else
+        return null;
+    }
+
+    private void StopService(Services svc) {
+      ServiceHost svcHost = null;
+      switch (svc) {
+        case Services.PermissionManager:
+          runningServices.TryGetValue(STR_PermissionManager, out svcHost);
+          break;
+        case Services.SecurityManager:
+          runningServices.TryGetValue(STR_SecurityManager, out svcHost);
+          break;
+        case Services.All:
+          foreach (KeyValuePair<string, ServiceHost> item in runningServices)
+            item.Value.Close();
+          return;
+        default:
+          throw new InvalidOperationException("Not supported!");
+      }
+      svcHost.Close();
+    }
+
+    public override void Run() {
+      IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
+      int index = 0;
+      if (System.Environment.OSVersion.Version.Major >= 6) {
+        for (index = addresses.Length - 1; index >= 0; index--)
+          if (addresses[index].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
+            break;
+      }
+      
+      //Start services and record their base address
+      Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>();
+      baseAddrDict.Add(STR_PermissionManager,
+        StartService(Services.PermissionManager, addresses[index], DEFAULT_PORT_PM));
+      baseAddrDict.Add(STR_SecurityManager,
+        StartService(Services.SecurityManager, addresses[index], DEFAULT_PORT_SM));
+
+      SecurityServer securityServer = new SecurityServer(baseAddrDict);
+
+      Application.Run(securityServer);
+
+      StopService(Services.All);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerPlugin.cs
===================================================================
--- /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerPlugin.cs	(revision 1724)
+++ /trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerPlugin.cs	(revision 1724)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Security.Server {
+  [ClassInfo(Name = "HeuristicLab.Security.Server-3.2")]
+  [PluginFile(Filename = "HeuristicLab.Security.Server-3.2.dll", Filetype = PluginFileType.Assembly)]
+  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
+  public class SecurityServerPlugin : PluginBase {
+  }
+}
Index: /trunk/sources/HeuristicLab.sln
===================================================================
--- /trunk/sources/HeuristicLab.sln	(revision 1723)
+++ /trunk/sources/HeuristicLab.sln	(revision 1724)
@@ -195,5 +195,5 @@
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "v3.3", "v3.3", "{78982D7C-D63D-4A3D-AE1F-F58AC007603B}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Security.Server-3.2", "HeuristicLab.Security.Server-3.2\3.2\HeuristicLab.Security.Server-3.2.csproj", "{E3288D4B-7A51-499A-AC5B-019319CE51DC}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Security.Server-3.2", "HeuristicLab.Security.Server\3.2\HeuristicLab.Security.Server-3.2.csproj", "{E3288D4B-7A51-499A-AC5B-019319CE51DC}"
 EndProject
 Global
@@ -2976,6 +2976,3 @@
 		{1BF17271-5350-476A-8F6D-FC74FA3E82CA} = {78982D7C-D63D-4A3D-AE1F-F58AC007603B}
 	EndGlobalSection
-	GlobalSection(TestCaseManagementSettings) = postSolution
-		CategoryFile = HeuristicLab.vsmdi
-	EndGlobalSection
 EndGlobal
Index: /trunk/sources/HeuristicLab/CopyAssemblies.cmd
===================================================================
--- /trunk/sources/HeuristicLab/CopyAssemblies.cmd	(revision 1723)
+++ /trunk/sources/HeuristicLab/CopyAssemblies.cmd	(revision 1724)
@@ -104,4 +104,5 @@
 copy "%SolutionDir%\HeuristicLab.Security.DataAccess\3.2\%Outdir%\HeuristicLab.Security.DataAccess-3.2.dll" .\plugins
 copy "%SolutionDir%\HeuristicLab.Security.ADODataAccess\3.2\%Outdir%\HeuristicLab.Security.ADODataAccess-3.2.dll" .\plugins
+copy "%SolutionDir%\HeuristicLab.Security.Server\3.2\%Outdir%\HeuristicLab.Security.Server-3.2.dll" .\plugins
 
 echo "Platform: %Platform%, architecture: %PROCESSOR_ARCHITECTURE%"
