Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/ADODataAccessPlugin.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/ADODataAccessPlugin.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/ADODataAccessPlugin.cs	(revision 4072)
@@ -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.DataAccess {
+  [Plugin("HeuristicLab.Security.ADODataAccess-3.2")]
+  [PluginFile("HeuristicLab.Security.ADODataAccess-3.2.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core-3.2")]
+  public class SecurityDataAccessPlugin : PluginBase {
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HLUserAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HLUserAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HLUserAdapter.cs	(revision 4072)
@@ -0,0 +1,119 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.Security.ADODataAccess.TableAdapterWrapper;
+
+namespace HeuristicLab.Security.ADODataAccess {
+  class HLUserAdapter: DataAdapterBase<
+      dsSecurityTableAdapters.HLUserTableAdapter, 
+      User, 
+      dsSecurity.HLUserRow>,
+      IUserAdapter {
+    public HLUserAdapter() :
+      base(new HLUserAdapterWrapper()) {
+    }
+
+    private IPermissionOwnerAdapter permOwnerAdapter = null;
+
+    private IPermissionOwnerAdapter PermOwnerAdapter {
+      get {
+        if (permOwnerAdapter == null)
+          permOwnerAdapter =
+            this.Session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+
+        return permOwnerAdapter;
+      }
+    }
+
+    protected override dsSecurity.HLUserRow ConvertObj(User user, dsSecurity.HLUserRow row) {
+      if (user != null && row != null) {
+        row.PermissionOwnerId = user.Id;
+        row.Login = user.Login;
+        row.MailAddress = user.MailAddress;
+        row.Password = user.Password;
+
+        return row;
+      } else {
+        return null;
+      }
+    }
+
+    protected override User ConvertRow(dsSecurity.HLUserRow row, User user) {
+      if (user != null && row != null) {
+        /*Parent - permissionOwner*/
+        user.Id = row.PermissionOwnerId;
+        PermOwnerAdapter.GetById(user);
+
+        if (!row.IsLoginNull())
+          user.Login = row.Login;
+        else
+          user.Login = String.Empty;
+
+        if (!row.IsPasswordNull())
+          user.SetPlainPassword(row.Password);
+        else
+          user.SetPlainPassword(String.Empty);
+
+        if (!row.IsMailAddressNull())
+          user.MailAddress = row.MailAddress;
+        else
+          user.MailAddress = String.Empty;
+
+        return user;
+      } else {
+        return null;
+      }
+    }
+
+    #region IUserAdapter Members
+
+    protected override void doUpdate(User user) {
+      if (user != null) {
+        PermOwnerAdapter.Update(user);
+
+        base.doUpdate(user);
+      }
+    }
+
+    protected override bool doDelete(User user) {
+      bool success = false;
+
+      if (user != null) {
+        dsSecurity.HLUserRow row =
+          GetRowById(user.Id);
+
+        if (row != null) {
+          success = base.doDelete(user) &&
+            PermOwnerAdapter.Delete(user);
+        }
+      }
+
+      return success;
+    }
+
+    public User GetByName(string name)
+    {
+      User user = new User();
+      PermissionOwner permOwner =
+        PermOwnerAdapter.GetByName(name);
+
+      if (permOwner != null)
+        return GetById(permOwner.Id);
+      else
+        return null;
+    }
+
+    public User GetByLogin(string login) {
+      return base.FindSingle(
+        delegate() {
+          return Adapter.GetDataByLogin(login);
+        });
+    }
+
+    #endregion
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HeuristicLab.Security.ADODataAccess-3.2.csproj
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HeuristicLab.Security.ADODataAccess-3.2.csproj	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/HeuristicLab.Security.ADODataAccess-3.2.csproj	(revision 4072)
@@ -0,0 +1,167 @@
+﻿<?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>{FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Security.ADODataAccess</RootNamespace>
+    <AssemblyName>HeuristicLab.Security.ADODataAccess-3.2</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <StartupObject>
+    </StartupObject>
+    <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>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <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>
+  -->
+  <ItemGroup>
+    <None Include="app.config" />
+    <None Include="datamodel_security_sqlserver.erwin" />
+    <None Include="dsSecurity.xsc">
+      <DependentUpon>dsSecurity.xsd</DependentUpon>
+    </None>
+    <None Include="dsSecurity.xsd">
+      <SubType>Designer</SubType>
+      <Generator>MSDataSetGenerator</Generator>
+      <LastGenOutput>dsSecurity.Designer.cs</LastGenOutput>
+    </None>
+    <None Include="dsSecurity.xss">
+      <DependentUpon>dsSecurity.xsd</DependentUpon>
+    </None>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="ADODataAccessPlugin.cs" />
+    <Compile Include="dsSecurity.cs">
+      <DependentUpon>dsSecurity.xsd</DependentUpon>
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="TableAdapterWrapper\GrantedPermissionsAdapterWrapper.cs" />
+    <Compile Include="TableAdapterWrapper\PermissionOwner_UserGroupAdapterWrapper.cs" />
+    <Compile Include="UserGroupAdapter.cs" />
+    <Compile Include="HLUserAdapter.cs" />
+    <Compile Include="PermissionOwnerAdapter.cs" />
+    <Compile Include="dsSecurity.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>dsSecurity.xsd</DependentUpon>
+    </Compile>
+    <Compile Include="PermissionAdapter.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>Settings.settings</DependentUpon>
+    </Compile>
+    <Compile Include="TableAdapterWrapper\UserGroupAdapterWrapper.cs" />
+    <Compile Include="TableAdapterWrapper\HLUserAdapterWrapper.cs" />
+    <Compile Include="TableAdapterWrapper\PermissionOwnerAdapterWrapper.cs" />
+    <Compile Include="TableAdapterWrapper\PermissionAdapterWrapper.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.DataAccess.ADOHelper\3.2\HeuristicLab.DataAccess.ADOHelper-3.2.csproj">
+      <Project>{5CDACE54-5FB2-4344-A21C-963F63CB7C2B}</Project>
+      <Name>HeuristicLab.DataAccess.ADOHelper-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.2\HeuristicLab.DataAccess-3.2.csproj">
+      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
+      <Name>HeuristicLab.DataAccess-3.2</Name>
+    </ProjectReference>
+    <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>
+    <ProjectReference Include="..\..\HeuristicLab.Security.DataAccess\3.2\HeuristicLab.Security.DataAccess-3.2.csproj">
+      <Project>{AC3D84FF-F0D7-43F0-9C99-9F8DBE087E2C}</Project>
+      <Name>HeuristicLab.Security.DataAccess-3.2</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+</Project>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionAdapter.cs	(revision 4072)
@@ -0,0 +1,147 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.Security.ADODataAccess.TableAdapterWrapper;
+
+namespace HeuristicLab.Security.ADODataAccess {
+  class PermissionAdapter: DataAdapterBase<
+      dsSecurityTableAdapters.PermissionTableAdapter, 
+      Permission, 
+      dsSecurity.PermissionRow>,
+      IPermissionAdapter {
+    public PermissionAdapter() :
+      base(new PermissionAdapterWrapper()) {
+    }
+
+    private GrantedPermissionsAdapterWrapper grantedPermissionsAdapter;
+
+    private GrantedPermissionsAdapterWrapper GrantedPermissionsAdapter {
+      get {
+        if (grantedPermissionsAdapter == null)
+          grantedPermissionsAdapter = new GrantedPermissionsAdapterWrapper();
+
+        grantedPermissionsAdapter.Session = Session as Session;
+
+        return grantedPermissionsAdapter;
+      }
+    }
+
+    private IUserGroupAdapter userGroupAdapter;
+
+    private IUserGroupAdapter UserGroupAdapter {
+      get {
+        if (userGroupAdapter == null)
+          userGroupAdapter = this.Session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+
+        return userGroupAdapter;
+      }
+    }
+
+    protected override dsSecurity.PermissionRow ConvertObj(Permission perm, 
+      dsSecurity.PermissionRow row) {
+      if (row != null && perm != null) {
+        row.PermissionId = perm.Id;
+        row.Name = perm.Name;
+        row.Description = perm.Description;
+        row.Plugin = perm.Plugin;
+
+        return row;
+      } else {
+        return null;
+      }
+    }
+
+    protected override Permission ConvertRow(dsSecurity.PermissionRow row,
+      Permission perm) {
+      if (row != null && perm != null) {
+        perm.Id = row.PermissionId;
+        if (!row.IsNameNull())
+          perm.Name = row.Name;
+        else
+          perm.Name = String.Empty;
+
+        if (!row.IsDescriptionNull())
+          perm.Description = row.Description;
+        else
+          perm.Description = String.Empty;
+
+        if (!row.IsPluginNull())
+          perm.Plugin = row.Plugin;
+        else
+          perm.Plugin = String.Empty;
+
+        return perm;
+      } else {
+        return null;
+      }
+    }
+
+    #region IPermissionAdapter Members
+
+    #endregion
+
+    #region IPermissionAdapter Members
+
+    public GrantedPermission getPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      dsSecurity.GrantedPermissionsRow row =
+          GrantedPermissionsAdapter.FindByPermissionPermissionOwnerEntityId(
+        permissionId, permissionOwnerId, entityId); 
+
+      if (row != null) {
+        GrantedPermission perm = new GrantedPermission();
+        perm.PermissionId = row.PermissionId;
+        perm.PermissionOwnerId = row.PermissionOwnerId;
+        perm.EntityId = row.EntityId;
+
+        return perm;
+      } else {
+        ICollection<UserGroup> groups =
+          UserGroupAdapter.MemberOf(permissionOwnerId);
+
+        GrantedPermission perm = null;
+
+        if (groups != null) {
+          foreach(UserGroup group in groups) {
+            perm = getPermission(group.Id, permissionId, entityId);
+
+            if (perm != null)
+              break;
+          }
+        }
+
+        return perm;
+      }
+    }
+
+    public bool grantPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      if (GrantedPermissionsAdapter.FindByPermissionPermissionOwnerEntityId(
+        permissionId, permissionOwnerId, entityId) == null) {
+        GrantedPermission perm = new GrantedPermission();
+        perm.PermissionId = permissionId;
+        perm.PermissionOwnerId = permissionOwnerId;
+        perm.EntityId = entityId;
+
+        return GrantedPermissionsAdapter.InsertNewRow(perm) != null;
+      } else {
+        return false;
+      }      
+    }
+
+    public bool revokePermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      GrantedPermission perm =
+        getPermission(permissionOwnerId, permissionId, entityId);
+      
+      if (perm != null) {
+        return GrantedPermissionsAdapter.DeleteRow(perm);
+      } else {
+        return false;
+      } 
+    }
+
+    #endregion
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionOwnerAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionOwnerAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/PermissionOwnerAdapter.cs	(revision 4072)
@@ -0,0 +1,140 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.Security.ADODataAccess.TableAdapterWrapper;
+
+namespace HeuristicLab.Security.ADODataAccess {
+  class PermissionOwnerAdapter: DataAdapterBase<
+      dsSecurityTableAdapters.PermissionOwnerTableAdapter, 
+      PermissionOwner, 
+      dsSecurity.PermissionOwnerRow>,
+      IPermissionOwnerAdapter {
+    public PermissionOwnerAdapter() : 
+      base(new PermissionOwnerAdapterWrapper()) {
+    }
+
+    private IUserAdapter userAdapter = null;
+
+    private IUserAdapter UserAdapter {
+      get {
+        if (userAdapter == null)
+          userAdapter =
+            this.Session.GetDataAdapter<User, IUserAdapter>();
+
+        return userAdapter;
+      }
+    }
+
+    private IUserGroupAdapter userGroupAdapter = null;
+
+    private IUserGroupAdapter UserGroupAdapter {
+      get {
+        if (userGroupAdapter == null)
+          userGroupAdapter =
+            this.Session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+
+        return userGroupAdapter;
+      }
+    }
+
+    protected override dsSecurity.PermissionOwnerRow ConvertObj(PermissionOwner permOwner, 
+      dsSecurity.PermissionOwnerRow row) {
+      if (row != null && permOwner != null) {
+        row.PermissionOwnerId = permOwner.Id;
+        row.Name = permOwner.Name;
+
+        return row;
+      } else {
+        return null;
+      }
+    }
+
+    protected override PermissionOwner ConvertRow(dsSecurity.PermissionOwnerRow row,
+      PermissionOwner permOwner) {
+      if (row != null && permOwner != null) {
+        permOwner.Id = row.PermissionOwnerId;
+
+        if (!row.IsNameNull())
+          permOwner.Name = row.Name;
+        else
+          permOwner.Name = String.Empty;
+
+        return permOwner;
+      } else {
+        return null;
+      }
+    }
+
+    #region IPermissionOwnerAdapter Members
+
+    public PermissionOwner GetByName(string name) {
+      return base.FindSingle(
+        delegate() {
+          return Adapter.GetDataByName(name);
+        });
+    }
+
+    public bool GetById(PermissionOwner permOwner) {
+      if (permOwner != null) {
+        dsSecurity.PermissionOwnerRow row =
+          GetRowById(permOwner.Id);
+
+        if (row != null) {
+          Convert(row, permOwner);
+
+          return true;
+        }
+      }
+
+      return false;
+    }
+
+    #endregion
+
+    #region IPolymorphicDataAdapter<PermissionOwner> Members
+
+    public void UpdatePolymorphic(PermissionOwner obj) {
+      if (obj is User) {
+        UserAdapter.Update(obj as User);
+      } else if (obj is UserGroup) {
+        UserGroupAdapter.Update(obj as UserGroup);
+      } else {
+        this.Update(obj);
+      }
+    }
+
+    public PermissionOwner GetByIdPolymorphic(Guid id) {
+      UserGroup group =
+        UserGroupAdapter.GetById(id);
+
+      if (group != null)
+        return group;
+      else {
+        User user =
+          UserAdapter.GetById(id);
+
+        if (user != null)
+          return user;
+        else {
+          return this.GetById(id);
+        }
+      }
+    }
+
+    public bool DeletePolymorphic(PermissionOwner obj) {
+      if (obj is User) {
+        return UserAdapter.Delete(obj as User);
+      } else if (obj is UserGroup) {
+        return UserGroupAdapter.Delete(obj as UserGroup);
+      } else {
+        return this.Delete(obj);
+      }
+    }
+
+    #endregion
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/AssemblyInfo.frame	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/AssemblyInfo.frame	(revision 4072)
@@ -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.ADODataAccess")]
+[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("35D8C228-76AF-4bcf-8002-9D41C7B3D29D")]
+
+// 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.Designer.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.Designer.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.Designer.cs	(revision 4072)
@@ -0,0 +1,37 @@
+﻿//------------------------------------------------------------------------------
+// <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.ADODataAccess.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.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security In" +
+            "fo=True;User ID=hive;Password=hive")]
+        public string HeuristicLab_SecurityConnectionString {
+            get {
+                return ((string)(this["HeuristicLab_SecurityConnectionString"]));
+            }
+        }
+    }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.settings
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.settings	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/Properties/Settings.settings	(revision 4072)
@@ -0,0 +1,14 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.Security.ADODataAccess_3._2.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="HeuristicLab_SecurityConnectionString" Type="(Connection string)" Scope="Application">
+      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
+  &lt;ConnectionString&gt;Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security Info=True;User ID=hive;Password=hive&lt;/ConnectionString&gt;
+  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
+&lt;/SerializableConnectionString&gt;</DesignTimeValue>
+      <Value Profile="(Default)">Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security Info=True;User ID=hive;Password=hive</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/GrantedPermissionsAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/GrantedPermissionsAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/GrantedPermissionsAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,81 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class GrantedPermissionsAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.GrantedPermissionsTableAdapter,
+       GrantedPermission,
+       dsSecurity.GrantedPermissionsRow> {
+    public override void UpdateRow(dsSecurity.GrantedPermissionsRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.GrantedPermissionsRow
+      InsertNewRow(GrantedPermission relation) {
+      dsSecurity.GrantedPermissionsDataTable data =
+        new dsSecurity.GrantedPermissionsDataTable();
+
+      dsSecurity.GrantedPermissionsRow row = data.NewGrantedPermissionsRow();
+      row.PermissionOwnerId = relation.PermissionOwnerId;
+      row.PermissionId = relation.PermissionId;
+      row.EntityId = relation.EntityId;
+
+      data.AddGrantedPermissionsRow(row);
+      TransactionalAdapter.Update(row);
+
+      return row;
+    }
+
+    public bool DeleteRow(GrantedPermission perm) {
+      dsSecurity.GrantedPermissionsRow row =
+        FindByPermissionPermissionOwnerEntityId(perm.PermissionId, perm.PermissionOwnerId, perm.EntityId);
+
+      if (row != null) {
+        row.Delete();
+        UpdateRow(row);
+
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+    public override IEnumerable<dsSecurity.GrantedPermissionsRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataByPermissionOwnerId(id);
+    }
+
+    public dsSecurity.GrantedPermissionsRow
+      FindByPermissionPermissionOwnerEntityId(Guid permissionId, 
+      Guid permissionOwnerId, Guid entityId) {
+      IEnumerable<dsSecurity.GrantedPermissionsRow> result = 
+        TransactionalAdapter.GetDataByPermissionPermissionOwnerEntityId(
+          permissionId, permissionOwnerId, entityId);
+
+      if (result.Count() == 1)
+        return result.First();
+      else
+        return null;
+    }
+
+    public override IEnumerable<dsSecurity.GrantedPermissionsRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/HLUserAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/HLUserAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/HLUserAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class HLUserAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.HLUserTableAdapter,
+       User,
+       dsSecurity.HLUserRow> {
+    public override void UpdateRow(dsSecurity.HLUserRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.HLUserRow
+      InsertNewRow(User user) {
+      dsSecurity.HLUserDataTable data =
+        new dsSecurity.HLUserDataTable();
+
+      dsSecurity.HLUserRow row = data.NewHLUserRow();
+      row.PermissionOwnerId = user.Id;
+      data.AddHLUserRow(row);
+
+      return row;
+    }
+
+    public override IEnumerable<dsSecurity.HLUserRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataById(id);
+    }
+
+    public override IEnumerable<dsSecurity.HLUserRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class PermissionAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.PermissionTableAdapter,
+       Permission,
+       dsSecurity.PermissionRow> {
+    public override void UpdateRow(dsSecurity.PermissionRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.PermissionRow
+      InsertNewRow(Permission permission) {
+      dsSecurity.PermissionDataTable data =
+        new dsSecurity.PermissionDataTable();
+
+      dsSecurity.PermissionRow row = data.NewPermissionRow();
+      row.PermissionId = permission.Id;
+      data.AddPermissionRow(row);
+
+      return row;
+    }
+
+    public override IEnumerable<dsSecurity.PermissionRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataById(id);
+    }
+
+    public override IEnumerable<dsSecurity.PermissionRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwnerAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwnerAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwnerAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class PermissionOwnerAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.PermissionOwnerTableAdapter,
+       PermissionOwner,
+       dsSecurity.PermissionOwnerRow> {
+    public override void UpdateRow(dsSecurity.PermissionOwnerRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.PermissionOwnerRow
+      InsertNewRow(PermissionOwner permission) {
+      dsSecurity.PermissionOwnerDataTable data =
+        new dsSecurity.PermissionOwnerDataTable();
+
+      dsSecurity.PermissionOwnerRow row = data.NewPermissionOwnerRow();
+      row.PermissionOwnerId = permission.Id;
+      data.AddPermissionOwnerRow(row);
+
+      return row;
+    }
+
+    public override IEnumerable<dsSecurity.PermissionOwnerRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataById(id);
+    }
+
+    public override IEnumerable<dsSecurity.PermissionOwnerRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwner_UserGroupAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwner_UserGroupAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/PermissionOwner_UserGroupAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,52 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class PermissionOwner_UserGroupAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.PermissionOwner_UserGroupTableAdapter,
+       ManyToManyRelation,
+       dsSecurity.PermissionOwner_UserGroupRow> {
+    public override void UpdateRow(dsSecurity.PermissionOwner_UserGroupRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.PermissionOwner_UserGroupRow
+      InsertNewRow(ManyToManyRelation relation) {
+      dsSecurity.PermissionOwner_UserGroupDataTable data =
+        new dsSecurity.PermissionOwner_UserGroupDataTable();
+
+      dsSecurity.PermissionOwner_UserGroupRow row = data.NewPermissionOwner_UserGroupRow();
+      row.UserGroupId = relation.Id;
+      row.PermissionOwnerId = relation.Id2;
+
+      data.AddPermissionOwner_UserGroupRow(row);
+
+      return row;
+    }
+
+    public override IEnumerable<dsSecurity.PermissionOwner_UserGroupRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataByUserGroupId(id);
+    }
+
+    public override IEnumerable<dsSecurity.PermissionOwner_UserGroupRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/UserGroupAdapterWrapper.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/UserGroupAdapterWrapper.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/TableAdapterWrapper/UserGroupAdapterWrapper.cs	(revision 4072)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using System.Data.SqlClient;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using System.Data.Common;
+
+namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
+  class UserGroupAdapterWrapper :
+   TableAdapterWrapperBase<
+       dsSecurityTableAdapters.UserGroupTableAdapter,
+       UserGroup,
+       dsSecurity.UserGroupRow> {
+    public override void UpdateRow(dsSecurity.UserGroupRow row) {
+      TransactionalAdapter.Update(row);
+    }
+
+    public override dsSecurity.UserGroupRow
+      InsertNewRow(UserGroup group) {
+      dsSecurity.UserGroupDataTable data =
+        new dsSecurity.UserGroupDataTable();
+
+      dsSecurity.UserGroupRow row = data.NewUserGroupRow();
+      row.PermissionOwnerId = group.Id;
+      data.AddUserGroupRow(row);
+
+      return row;
+    }
+
+    public override IEnumerable<dsSecurity.UserGroupRow>
+      FindById(Guid id) {
+      return TransactionalAdapter.GetDataById(id);
+    }
+
+    public override IEnumerable<dsSecurity.UserGroupRow>
+      FindAll() {
+      return TransactionalAdapter.GetData();
+    }
+
+    protected override void SetConnection(DbConnection connection) {
+      adapter.Connection = connection as SqlConnection;
+    }
+
+    protected override void SetTransaction(DbTransaction transaction) {
+      adapter.Transaction = transaction as SqlTransaction;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/UserGroupAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/UserGroupAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/UserGroupAdapter.cs	(revision 4072)
@@ -0,0 +1,140 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAccess.ADOHelper;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.Security.ADODataAccess.TableAdapterWrapper;
+
+namespace HeuristicLab.Security.ADODataAccess {
+  class UserGroupAdapter: DataAdapterBase<
+      dsSecurityTableAdapters.UserGroupTableAdapter, 
+      UserGroup, 
+      dsSecurity.UserGroupRow>,
+      IUserGroupAdapter {
+    public UserGroupAdapter() :
+      base(new UserGroupAdapterWrapper()) {
+    }
+
+    private ManyToManyRelationHelper<
+      dsSecurityTableAdapters.PermissionOwner_UserGroupTableAdapter,
+      dsSecurity.PermissionOwner_UserGroupRow> manyToManyRelationHelper = null;
+
+    private ManyToManyRelationHelper<dsSecurityTableAdapters.PermissionOwner_UserGroupTableAdapter,
+      dsSecurity.PermissionOwner_UserGroupRow> ManyToManyRelationHelper {
+      get {
+        if (manyToManyRelationHelper == null) {
+          manyToManyRelationHelper =
+            new ManyToManyRelationHelper<dsSecurityTableAdapters.PermissionOwner_UserGroupTableAdapter,
+              dsSecurity.PermissionOwner_UserGroupRow>(new PermissionOwner_UserGroupAdapterWrapper(), 0);
+        }
+
+        manyToManyRelationHelper.Session = Session as Session;
+
+        return manyToManyRelationHelper;
+      }
+    }
+
+    private IPermissionOwnerAdapter permOwnerAdapter = null;
+
+    private IPermissionOwnerAdapter PermOwnerAdapter {
+      get {
+        if (permOwnerAdapter == null)
+          permOwnerAdapter =
+            this.Session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+
+        return permOwnerAdapter;
+      }
+    }
+
+    protected override dsSecurity.UserGroupRow ConvertObj(UserGroup group, 
+      dsSecurity.UserGroupRow row) {
+      if (group != null && row != null) {
+        row.PermissionOwnerId = group.Id;
+
+        return row;
+      } else {
+        return null;
+      }
+    }
+
+    protected override UserGroup ConvertRow(dsSecurity.UserGroupRow row,
+      UserGroup group) {
+      if (group != null && row != null) {
+        group.Id = row.PermissionOwnerId;
+        PermOwnerAdapter.GetById(group);
+
+        ICollection<Guid> permissionOwners =
+          ManyToManyRelationHelper.GetRelationships(group.Id);
+
+        group.Members.Clear();
+        foreach (Guid permissionOwner in permissionOwners) {
+          PermissionOwner permOwner =
+            PermOwnerAdapter.GetByIdPolymorphic(permissionOwner);
+
+          group.Members.Add(permOwner);
+        }
+
+        return group;
+      } else {
+        return null;
+      }
+    }
+
+    #region IUserGroupAdapter Members
+
+    protected override void doUpdate(UserGroup group) {
+      if (group != null) {
+        PermOwnerAdapter.Update(group);
+
+        base.doUpdate(group);
+
+        List<Guid> relationships =
+          new List<Guid>();
+        foreach (PermissionOwner permOwner in group.Members) {
+          PermOwnerAdapter.UpdatePolymorphic(permOwner);
+
+          relationships.Add(permOwner.Id);
+        }
+
+        ManyToManyRelationHelper.UpdateRelationships(group.Id,
+          relationships);
+      }
+    }
+
+    protected override bool doDelete(UserGroup group) {
+      if (group != null) {
+        //delete all relationships
+        ManyToManyRelationHelper.UpdateRelationships(group.Id,
+          new List<Guid>());
+
+        return base.doDelete(group) &&
+          PermOwnerAdapter.Delete(group);
+      }
+
+      return false;
+    }
+
+    public UserGroup GetByName(string name) {
+      UserGroup group = new UserGroup();
+      PermissionOwner permOwner =
+        PermOwnerAdapter.GetByName(name);
+
+      if (permOwner != null)
+        return GetById(permOwner.Id);
+      else
+        return null;
+    }
+
+    public ICollection<UserGroup> MemberOf(Guid permissionOwnerId) {
+      return base.FindMultiple(
+        delegate() {
+          return Adapter.GetDataByMemberOf(permissionOwnerId);
+        }
+      );
+    }
+
+    #endregion
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/app.config
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/app.config	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/app.config	(revision 4072)
@@ -0,0 +1,10 @@
+﻿<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+    </configSections>
+    <connectionStrings>
+        <add name="HeuristicLab.Security.ADODataAccess_3._2.Properties.Settings.HeuristicLab_SecurityConnectionString"
+            connectionString="Data Source=10.20.71.10;Initial Catalog=HeuristicLab.Security;Persist Security Info=True;User ID=hive;Password=hive"
+            providerName="System.Data.SqlClient" />
+    </connectionStrings>
+</configuration>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.Designer.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.Designer.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.Designer.cs	(revision 4072)
@@ -0,0 +1,5617 @@
+﻿//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+#pragma warning disable 1591
+
+namespace HeuristicLab.Security.ADODataAccess {
+    
+    
+    /// <summary>
+    ///Represents a strongly typed in-memory cache of data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.Serializable()]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
+    [global::System.Xml.Serialization.XmlRootAttribute("dsSecurity")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
+    public partial class dsSecurity : global::System.Data.DataSet {
+        
+        private GrantedPermissionsDataTable tableGrantedPermissions;
+        
+        private UserGroupDataTable tableUserGroup;
+        
+        private HLUserDataTable tableHLUser;
+        
+        private PermissionDataTable tablePermission;
+        
+        private PermissionOwnerDataTable tablePermissionOwner;
+        
+        private PermissionOwner_UserGroupDataTable tablePermissionOwner_UserGroup;
+        
+        private global::System.Data.DataRelation relationR_49;
+        
+        private global::System.Data.DataRelation relationR_50;
+        
+        private global::System.Data.DataRelation relationUserGroup_is_a_PermissionOwner;
+        
+        private global::System.Data.DataRelation relationUser_is_a_PermissionOwner;
+        
+        private global::System.Data.DataRelation relationR_44;
+        
+        private global::System.Data.DataRelation relationR_57;
+        
+        private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public dsSecurity() {
+            this.BeginInit();
+            this.InitClass();
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            base.Relations.CollectionChanged += schemaChangedHandler;
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected dsSecurity(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                base(info, context, false) {
+            if ((this.IsBinarySerialized(info, context) == true)) {
+                this.InitVars(false);
+                global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+                this.Tables.CollectionChanged += schemaChangedHandler1;
+                this.Relations.CollectionChanged += schemaChangedHandler1;
+                return;
+            }
+            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
+            if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+                if ((ds.Tables["GrantedPermissions"] != null)) {
+                    base.Tables.Add(new GrantedPermissionsDataTable(ds.Tables["GrantedPermissions"]));
+                }
+                if ((ds.Tables["UserGroup"] != null)) {
+                    base.Tables.Add(new UserGroupDataTable(ds.Tables["UserGroup"]));
+                }
+                if ((ds.Tables["HLUser"] != null)) {
+                    base.Tables.Add(new HLUserDataTable(ds.Tables["HLUser"]));
+                }
+                if ((ds.Tables["Permission"] != null)) {
+                    base.Tables.Add(new PermissionDataTable(ds.Tables["Permission"]));
+                }
+                if ((ds.Tables["PermissionOwner"] != null)) {
+                    base.Tables.Add(new PermissionOwnerDataTable(ds.Tables["PermissionOwner"]));
+                }
+                if ((ds.Tables["PermissionOwner_UserGroup"] != null)) {
+                    base.Tables.Add(new PermissionOwner_UserGroupDataTable(ds.Tables["PermissionOwner_UserGroup"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+            }
+            this.GetSerializationData(info, context);
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            this.Relations.CollectionChanged += schemaChangedHandler;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public GrantedPermissionsDataTable GrantedPermissions {
+            get {
+                return this.tableGrantedPermissions;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public UserGroupDataTable UserGroup {
+            get {
+                return this.tableUserGroup;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public HLUserDataTable HLUser {
+            get {
+                return this.tableHLUser;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public PermissionDataTable Permission {
+            get {
+                return this.tablePermission;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public PermissionOwnerDataTable PermissionOwner {
+            get {
+                return this.tablePermissionOwner;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public PermissionOwner_UserGroupDataTable PermissionOwner_UserGroup {
+            get {
+                return this.tablePermissionOwner_UserGroup;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.BrowsableAttribute(true)]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
+        public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
+            get {
+                return this._schemaSerializationMode;
+            }
+            set {
+                this._schemaSerializationMode = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataTableCollection Tables {
+            get {
+                return base.Tables;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataRelationCollection Relations {
+            get {
+                return base.Relations;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void InitializeDerivedDataSet() {
+            this.BeginInit();
+            this.InitClass();
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public override global::System.Data.DataSet Clone() {
+            dsSecurity cln = ((dsSecurity)(base.Clone()));
+            cln.InitVars();
+            cln.SchemaSerializationMode = this.SchemaSerializationMode;
+            return cln;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeTables() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeRelations() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
+            if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                this.Reset();
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXml(reader);
+                if ((ds.Tables["GrantedPermissions"] != null)) {
+                    base.Tables.Add(new GrantedPermissionsDataTable(ds.Tables["GrantedPermissions"]));
+                }
+                if ((ds.Tables["UserGroup"] != null)) {
+                    base.Tables.Add(new UserGroupDataTable(ds.Tables["UserGroup"]));
+                }
+                if ((ds.Tables["HLUser"] != null)) {
+                    base.Tables.Add(new HLUserDataTable(ds.Tables["HLUser"]));
+                }
+                if ((ds.Tables["Permission"] != null)) {
+                    base.Tables.Add(new PermissionDataTable(ds.Tables["Permission"]));
+                }
+                if ((ds.Tables["PermissionOwner"] != null)) {
+                    base.Tables.Add(new PermissionOwnerDataTable(ds.Tables["PermissionOwner"]));
+                }
+                if ((ds.Tables["PermissionOwner_UserGroup"] != null)) {
+                    base.Tables.Add(new PermissionOwner_UserGroupDataTable(ds.Tables["PermissionOwner_UserGroup"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXml(reader);
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
+            global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
+            this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
+            stream.Position = 0;
+            return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars() {
+            this.InitVars(true);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars(bool initTable) {
+            this.tableGrantedPermissions = ((GrantedPermissionsDataTable)(base.Tables["GrantedPermissions"]));
+            if ((initTable == true)) {
+                if ((this.tableGrantedPermissions != null)) {
+                    this.tableGrantedPermissions.InitVars();
+                }
+            }
+            this.tableUserGroup = ((UserGroupDataTable)(base.Tables["UserGroup"]));
+            if ((initTable == true)) {
+                if ((this.tableUserGroup != null)) {
+                    this.tableUserGroup.InitVars();
+                }
+            }
+            this.tableHLUser = ((HLUserDataTable)(base.Tables["HLUser"]));
+            if ((initTable == true)) {
+                if ((this.tableHLUser != null)) {
+                    this.tableHLUser.InitVars();
+                }
+            }
+            this.tablePermission = ((PermissionDataTable)(base.Tables["Permission"]));
+            if ((initTable == true)) {
+                if ((this.tablePermission != null)) {
+                    this.tablePermission.InitVars();
+                }
+            }
+            this.tablePermissionOwner = ((PermissionOwnerDataTable)(base.Tables["PermissionOwner"]));
+            if ((initTable == true)) {
+                if ((this.tablePermissionOwner != null)) {
+                    this.tablePermissionOwner.InitVars();
+                }
+            }
+            this.tablePermissionOwner_UserGroup = ((PermissionOwner_UserGroupDataTable)(base.Tables["PermissionOwner_UserGroup"]));
+            if ((initTable == true)) {
+                if ((this.tablePermissionOwner_UserGroup != null)) {
+                    this.tablePermissionOwner_UserGroup.InitVars();
+                }
+            }
+            this.relationR_49 = this.Relations["R_49"];
+            this.relationR_50 = this.Relations["R_50"];
+            this.relationUserGroup_is_a_PermissionOwner = this.Relations["UserGroup_is_a_PermissionOwner"];
+            this.relationUser_is_a_PermissionOwner = this.Relations["User_is_a_PermissionOwner"];
+            this.relationR_44 = this.Relations["R_44"];
+            this.relationR_57 = this.Relations["R_57"];
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitClass() {
+            this.DataSetName = "dsSecurity";
+            this.Prefix = "";
+            this.Namespace = "http://tempuri.org/dsSecurity.xsd";
+            this.EnforceConstraints = true;
+            this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+            this.tableGrantedPermissions = new GrantedPermissionsDataTable();
+            base.Tables.Add(this.tableGrantedPermissions);
+            this.tableUserGroup = new UserGroupDataTable();
+            base.Tables.Add(this.tableUserGroup);
+            this.tableHLUser = new HLUserDataTable();
+            base.Tables.Add(this.tableHLUser);
+            this.tablePermission = new PermissionDataTable();
+            base.Tables.Add(this.tablePermission);
+            this.tablePermissionOwner = new PermissionOwnerDataTable();
+            base.Tables.Add(this.tablePermissionOwner);
+            this.tablePermissionOwner_UserGroup = new PermissionOwner_UserGroupDataTable();
+            base.Tables.Add(this.tablePermissionOwner_UserGroup);
+            this.relationR_49 = new global::System.Data.DataRelation("R_49", new global::System.Data.DataColumn[] {
+                        this.tablePermission.PermissionIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tableGrantedPermissions.PermissionIdColumn}, false);
+            this.Relations.Add(this.relationR_49);
+            this.relationR_50 = new global::System.Data.DataRelation("R_50", new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner.PermissionOwnerIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tableGrantedPermissions.PermissionOwnerIdColumn}, false);
+            this.Relations.Add(this.relationR_50);
+            this.relationUserGroup_is_a_PermissionOwner = new global::System.Data.DataRelation("UserGroup_is_a_PermissionOwner", new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner.PermissionOwnerIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tableUserGroup.PermissionOwnerIdColumn}, false);
+            this.Relations.Add(this.relationUserGroup_is_a_PermissionOwner);
+            this.relationUser_is_a_PermissionOwner = new global::System.Data.DataRelation("User_is_a_PermissionOwner", new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner.PermissionOwnerIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tableHLUser.PermissionOwnerIdColumn}, false);
+            this.Relations.Add(this.relationUser_is_a_PermissionOwner);
+            this.relationR_44 = new global::System.Data.DataRelation("R_44", new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner.PermissionOwnerIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner_UserGroup.PermissionOwnerIdColumn}, false);
+            this.Relations.Add(this.relationR_44);
+            this.relationR_57 = new global::System.Data.DataRelation("R_57", new global::System.Data.DataColumn[] {
+                        this.tableUserGroup.PermissionOwnerIdColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePermissionOwner_UserGroup.UserGroupIdColumn}, false);
+            this.Relations.Add(this.relationR_57);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializeGrantedPermissions() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializeUserGroup() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializeHLUser() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializePermission() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializePermissionOwner() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializePermissionOwner_UserGroup() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
+            if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+            dsSecurity ds = new dsSecurity();
+            global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+            global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+            global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
+            any.Namespace = ds.Namespace;
+            sequence.Items.Add(any);
+            type.Particle = sequence;
+            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+            if (xs.Contains(dsSchema.TargetNamespace)) {
+                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                try {
+                    global::System.Xml.Schema.XmlSchema schema = null;
+                    dsSchema.Write(s1);
+                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                        s2.SetLength(0);
+                        schema.Write(s2);
+                        if ((s1.Length == s2.Length)) {
+                            s1.Position = 0;
+                            s2.Position = 0;
+                            for (; ((s1.Position != s1.Length) 
+                                        && (s1.ReadByte() == s2.ReadByte())); ) {
+                                ;
+                            }
+                            if ((s1.Position == s1.Length)) {
+                                return type;
+                            }
+                        }
+                    }
+                }
+                finally {
+                    if ((s1 != null)) {
+                        s1.Close();
+                    }
+                    if ((s2 != null)) {
+                        s2.Close();
+                    }
+                }
+            }
+            xs.Add(dsSchema);
+            return type;
+        }
+        
+        public delegate void GrantedPermissionsRowChangeEventHandler(object sender, GrantedPermissionsRowChangeEvent e);
+        
+        public delegate void UserGroupRowChangeEventHandler(object sender, UserGroupRowChangeEvent e);
+        
+        public delegate void HLUserRowChangeEventHandler(object sender, HLUserRowChangeEvent e);
+        
+        public delegate void PermissionRowChangeEventHandler(object sender, PermissionRowChangeEvent e);
+        
+        public delegate void PermissionOwnerRowChangeEventHandler(object sender, PermissionOwnerRowChangeEvent e);
+        
+        public delegate void PermissionOwner_UserGroupRowChangeEventHandler(object sender, PermissionOwner_UserGroupRowChangeEvent e);
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class GrantedPermissionsDataTable : global::System.Data.TypedTableBase<GrantedPermissionsRow> {
+            
+            private global::System.Data.DataColumn columnPermissionId;
+            
+            private global::System.Data.DataColumn columnPermissionOwnerId;
+            
+            private global::System.Data.DataColumn columnEntityId;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsDataTable() {
+                this.TableName = "GrantedPermissions";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal GrantedPermissionsDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected GrantedPermissionsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionIdColumn {
+                get {
+                    return this.columnPermissionId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionOwnerIdColumn {
+                get {
+                    return this.columnPermissionOwnerId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn EntityIdColumn {
+                get {
+                    return this.columnEntityId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow this[int index] {
+                get {
+                    return ((GrantedPermissionsRow)(this.Rows[index]));
+                }
+            }
+            
+            public event GrantedPermissionsRowChangeEventHandler GrantedPermissionsRowChanging;
+            
+            public event GrantedPermissionsRowChangeEventHandler GrantedPermissionsRowChanged;
+            
+            public event GrantedPermissionsRowChangeEventHandler GrantedPermissionsRowDeleting;
+            
+            public event GrantedPermissionsRowChangeEventHandler GrantedPermissionsRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddGrantedPermissionsRow(GrantedPermissionsRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow AddGrantedPermissionsRow(PermissionRow parentPermissionRowByR_49, PermissionOwnerRow parentPermissionOwnerRowByR_50, System.Guid EntityId) {
+                GrantedPermissionsRow rowGrantedPermissionsRow = ((GrantedPermissionsRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        null,
+                        null,
+                        EntityId};
+                if ((parentPermissionRowByR_49 != null)) {
+                    columnValuesArray[0] = parentPermissionRowByR_49[0];
+                }
+                if ((parentPermissionOwnerRowByR_50 != null)) {
+                    columnValuesArray[1] = parentPermissionOwnerRowByR_50[0];
+                }
+                rowGrantedPermissionsRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowGrantedPermissionsRow);
+                return rowGrantedPermissionsRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow FindByPermissionIdPermissionOwnerIdEntityId(System.Guid PermissionId, System.Guid PermissionOwnerId, System.Guid EntityId) {
+                return ((GrantedPermissionsRow)(this.Rows.Find(new object[] {
+                            PermissionId,
+                            PermissionOwnerId,
+                            EntityId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                GrantedPermissionsDataTable cln = ((GrantedPermissionsDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new GrantedPermissionsDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionId = base.Columns["PermissionId"];
+                this.columnPermissionOwnerId = base.Columns["PermissionOwnerId"];
+                this.columnEntityId = base.Columns["EntityId"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionId = new global::System.Data.DataColumn("PermissionId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionId);
+                this.columnPermissionOwnerId = new global::System.Data.DataColumn("PermissionOwnerId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionOwnerId);
+                this.columnEntityId = new global::System.Data.DataColumn("EntityId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnEntityId);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionId,
+                                this.columnPermissionOwnerId,
+                                this.columnEntityId}, true));
+                this.columnPermissionId.AllowDBNull = false;
+                this.columnPermissionOwnerId.AllowDBNull = false;
+                this.columnEntityId.AllowDBNull = false;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow NewGrantedPermissionsRow() {
+                return ((GrantedPermissionsRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new GrantedPermissionsRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(GrantedPermissionsRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.GrantedPermissionsRowChanged != null)) {
+                    this.GrantedPermissionsRowChanged(this, new GrantedPermissionsRowChangeEvent(((GrantedPermissionsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.GrantedPermissionsRowChanging != null)) {
+                    this.GrantedPermissionsRowChanging(this, new GrantedPermissionsRowChangeEvent(((GrantedPermissionsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.GrantedPermissionsRowDeleted != null)) {
+                    this.GrantedPermissionsRowDeleted(this, new GrantedPermissionsRowChangeEvent(((GrantedPermissionsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.GrantedPermissionsRowDeleting != null)) {
+                    this.GrantedPermissionsRowDeleting(this, new GrantedPermissionsRowChangeEvent(((GrantedPermissionsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemoveGrantedPermissionsRow(GrantedPermissionsRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "GrantedPermissionsDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class UserGroupDataTable : global::System.Data.TypedTableBase<UserGroupRow> {
+            
+            private global::System.Data.DataColumn columnPermissionOwnerId;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupDataTable() {
+                this.TableName = "UserGroup";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal UserGroupDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected UserGroupDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionOwnerIdColumn {
+                get {
+                    return this.columnPermissionOwnerId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow this[int index] {
+                get {
+                    return ((UserGroupRow)(this.Rows[index]));
+                }
+            }
+            
+            public event UserGroupRowChangeEventHandler UserGroupRowChanging;
+            
+            public event UserGroupRowChangeEventHandler UserGroupRowChanged;
+            
+            public event UserGroupRowChangeEventHandler UserGroupRowDeleting;
+            
+            public event UserGroupRowChangeEventHandler UserGroupRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddUserGroupRow(UserGroupRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow AddUserGroupRow(PermissionOwnerRow parentPermissionOwnerRowByUserGroup_is_a_PermissionOwner) {
+                UserGroupRow rowUserGroupRow = ((UserGroupRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        null};
+                if ((parentPermissionOwnerRowByUserGroup_is_a_PermissionOwner != null)) {
+                    columnValuesArray[0] = parentPermissionOwnerRowByUserGroup_is_a_PermissionOwner[0];
+                }
+                rowUserGroupRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowUserGroupRow);
+                return rowUserGroupRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow FindByPermissionOwnerId(System.Guid PermissionOwnerId) {
+                return ((UserGroupRow)(this.Rows.Find(new object[] {
+                            PermissionOwnerId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                UserGroupDataTable cln = ((UserGroupDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new UserGroupDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionOwnerId = base.Columns["PermissionOwnerId"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionOwnerId = new global::System.Data.DataColumn("PermissionOwnerId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionOwnerId);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionOwnerId}, true));
+                this.columnPermissionOwnerId.AllowDBNull = false;
+                this.columnPermissionOwnerId.Unique = true;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow NewUserGroupRow() {
+                return ((UserGroupRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new UserGroupRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(UserGroupRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.UserGroupRowChanged != null)) {
+                    this.UserGroupRowChanged(this, new UserGroupRowChangeEvent(((UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.UserGroupRowChanging != null)) {
+                    this.UserGroupRowChanging(this, new UserGroupRowChangeEvent(((UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.UserGroupRowDeleted != null)) {
+                    this.UserGroupRowDeleted(this, new UserGroupRowChangeEvent(((UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.UserGroupRowDeleting != null)) {
+                    this.UserGroupRowDeleting(this, new UserGroupRowChangeEvent(((UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemoveUserGroupRow(UserGroupRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "UserGroupDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class HLUserDataTable : global::System.Data.TypedTableBase<HLUserRow> {
+            
+            private global::System.Data.DataColumn columnPermissionOwnerId;
+            
+            private global::System.Data.DataColumn columnPassword;
+            
+            private global::System.Data.DataColumn columnLogin;
+            
+            private global::System.Data.DataColumn columnMailAddress;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserDataTable() {
+                this.TableName = "HLUser";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal HLUserDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected HLUserDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionOwnerIdColumn {
+                get {
+                    return this.columnPermissionOwnerId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PasswordColumn {
+                get {
+                    return this.columnPassword;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn LoginColumn {
+                get {
+                    return this.columnLogin;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn MailAddressColumn {
+                get {
+                    return this.columnMailAddress;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow this[int index] {
+                get {
+                    return ((HLUserRow)(this.Rows[index]));
+                }
+            }
+            
+            public event HLUserRowChangeEventHandler HLUserRowChanging;
+            
+            public event HLUserRowChangeEventHandler HLUserRowChanged;
+            
+            public event HLUserRowChangeEventHandler HLUserRowDeleting;
+            
+            public event HLUserRowChangeEventHandler HLUserRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddHLUserRow(HLUserRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow AddHLUserRow(PermissionOwnerRow parentPermissionOwnerRowByUser_is_a_PermissionOwner, string Password, string Login, string MailAddress) {
+                HLUserRow rowHLUserRow = ((HLUserRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        null,
+                        Password,
+                        Login,
+                        MailAddress};
+                if ((parentPermissionOwnerRowByUser_is_a_PermissionOwner != null)) {
+                    columnValuesArray[0] = parentPermissionOwnerRowByUser_is_a_PermissionOwner[0];
+                }
+                rowHLUserRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowHLUserRow);
+                return rowHLUserRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow FindByPermissionOwnerId(System.Guid PermissionOwnerId) {
+                return ((HLUserRow)(this.Rows.Find(new object[] {
+                            PermissionOwnerId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                HLUserDataTable cln = ((HLUserDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new HLUserDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionOwnerId = base.Columns["PermissionOwnerId"];
+                this.columnPassword = base.Columns["Password"];
+                this.columnLogin = base.Columns["Login"];
+                this.columnMailAddress = base.Columns["MailAddress"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionOwnerId = new global::System.Data.DataColumn("PermissionOwnerId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionOwnerId);
+                this.columnPassword = new global::System.Data.DataColumn("Password", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPassword);
+                this.columnLogin = new global::System.Data.DataColumn("Login", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnLogin);
+                this.columnMailAddress = new global::System.Data.DataColumn("MailAddress", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnMailAddress);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionOwnerId}, true));
+                this.columnPermissionOwnerId.AllowDBNull = false;
+                this.columnPermissionOwnerId.Unique = true;
+                this.columnPassword.MaxLength = 2147483647;
+                this.columnLogin.MaxLength = 2147483647;
+                this.columnMailAddress.MaxLength = 2147483647;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow NewHLUserRow() {
+                return ((HLUserRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new HLUserRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(HLUserRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.HLUserRowChanged != null)) {
+                    this.HLUserRowChanged(this, new HLUserRowChangeEvent(((HLUserRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.HLUserRowChanging != null)) {
+                    this.HLUserRowChanging(this, new HLUserRowChangeEvent(((HLUserRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.HLUserRowDeleted != null)) {
+                    this.HLUserRowDeleted(this, new HLUserRowChangeEvent(((HLUserRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.HLUserRowDeleting != null)) {
+                    this.HLUserRowDeleting(this, new HLUserRowChangeEvent(((HLUserRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemoveHLUserRow(HLUserRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "HLUserDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class PermissionDataTable : global::System.Data.TypedTableBase<PermissionRow> {
+            
+            private global::System.Data.DataColumn columnPermissionId;
+            
+            private global::System.Data.DataColumn columnName;
+            
+            private global::System.Data.DataColumn columnDescription;
+            
+            private global::System.Data.DataColumn columnPlugin;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionDataTable() {
+                this.TableName = "Permission";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected PermissionDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionIdColumn {
+                get {
+                    return this.columnPermissionId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NameColumn {
+                get {
+                    return this.columnName;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn DescriptionColumn {
+                get {
+                    return this.columnDescription;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PluginColumn {
+                get {
+                    return this.columnPlugin;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow this[int index] {
+                get {
+                    return ((PermissionRow)(this.Rows[index]));
+                }
+            }
+            
+            public event PermissionRowChangeEventHandler PermissionRowChanging;
+            
+            public event PermissionRowChangeEventHandler PermissionRowChanged;
+            
+            public event PermissionRowChangeEventHandler PermissionRowDeleting;
+            
+            public event PermissionRowChangeEventHandler PermissionRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddPermissionRow(PermissionRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow AddPermissionRow(System.Guid PermissionId, string Name, string Description, string Plugin) {
+                PermissionRow rowPermissionRow = ((PermissionRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        PermissionId,
+                        Name,
+                        Description,
+                        Plugin};
+                rowPermissionRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowPermissionRow);
+                return rowPermissionRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow FindByPermissionId(System.Guid PermissionId) {
+                return ((PermissionRow)(this.Rows.Find(new object[] {
+                            PermissionId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                PermissionDataTable cln = ((PermissionDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new PermissionDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionId = base.Columns["PermissionId"];
+                this.columnName = base.Columns["Name"];
+                this.columnDescription = base.Columns["Description"];
+                this.columnPlugin = base.Columns["Plugin"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionId = new global::System.Data.DataColumn("PermissionId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionId);
+                this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnName);
+                this.columnDescription = new global::System.Data.DataColumn("Description", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnDescription);
+                this.columnPlugin = new global::System.Data.DataColumn("Plugin", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPlugin);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionId}, true));
+                this.columnPermissionId.AllowDBNull = false;
+                this.columnPermissionId.Unique = true;
+                this.columnName.MaxLength = 2147483647;
+                this.columnDescription.MaxLength = 2147483647;
+                this.columnPlugin.MaxLength = 2147483647;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow NewPermissionRow() {
+                return ((PermissionRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new PermissionRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(PermissionRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.PermissionRowChanged != null)) {
+                    this.PermissionRowChanged(this, new PermissionRowChangeEvent(((PermissionRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.PermissionRowChanging != null)) {
+                    this.PermissionRowChanging(this, new PermissionRowChangeEvent(((PermissionRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.PermissionRowDeleted != null)) {
+                    this.PermissionRowDeleted(this, new PermissionRowChangeEvent(((PermissionRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.PermissionRowDeleting != null)) {
+                    this.PermissionRowDeleting(this, new PermissionRowChangeEvent(((PermissionRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemovePermissionRow(PermissionRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "PermissionDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class PermissionOwnerDataTable : global::System.Data.TypedTableBase<PermissionOwnerRow> {
+            
+            private global::System.Data.DataColumn columnPermissionOwnerId;
+            
+            private global::System.Data.DataColumn columnName;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerDataTable() {
+                this.TableName = "PermissionOwner";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionOwnerDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected PermissionOwnerDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionOwnerIdColumn {
+                get {
+                    return this.columnPermissionOwnerId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NameColumn {
+                get {
+                    return this.columnName;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow this[int index] {
+                get {
+                    return ((PermissionOwnerRow)(this.Rows[index]));
+                }
+            }
+            
+            public event PermissionOwnerRowChangeEventHandler PermissionOwnerRowChanging;
+            
+            public event PermissionOwnerRowChangeEventHandler PermissionOwnerRowChanged;
+            
+            public event PermissionOwnerRowChangeEventHandler PermissionOwnerRowDeleting;
+            
+            public event PermissionOwnerRowChangeEventHandler PermissionOwnerRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddPermissionOwnerRow(PermissionOwnerRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow AddPermissionOwnerRow(System.Guid PermissionOwnerId, string Name) {
+                PermissionOwnerRow rowPermissionOwnerRow = ((PermissionOwnerRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        PermissionOwnerId,
+                        Name};
+                rowPermissionOwnerRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowPermissionOwnerRow);
+                return rowPermissionOwnerRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow FindByPermissionOwnerId(System.Guid PermissionOwnerId) {
+                return ((PermissionOwnerRow)(this.Rows.Find(new object[] {
+                            PermissionOwnerId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                PermissionOwnerDataTable cln = ((PermissionOwnerDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new PermissionOwnerDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionOwnerId = base.Columns["PermissionOwnerId"];
+                this.columnName = base.Columns["Name"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionOwnerId = new global::System.Data.DataColumn("PermissionOwnerId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionOwnerId);
+                this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnName);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionOwnerId}, true));
+                this.columnPermissionOwnerId.AllowDBNull = false;
+                this.columnPermissionOwnerId.Unique = true;
+                this.columnName.MaxLength = 2147483647;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow NewPermissionOwnerRow() {
+                return ((PermissionOwnerRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new PermissionOwnerRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(PermissionOwnerRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.PermissionOwnerRowChanged != null)) {
+                    this.PermissionOwnerRowChanged(this, new PermissionOwnerRowChangeEvent(((PermissionOwnerRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.PermissionOwnerRowChanging != null)) {
+                    this.PermissionOwnerRowChanging(this, new PermissionOwnerRowChangeEvent(((PermissionOwnerRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.PermissionOwnerRowDeleted != null)) {
+                    this.PermissionOwnerRowDeleted(this, new PermissionOwnerRowChangeEvent(((PermissionOwnerRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.PermissionOwnerRowDeleting != null)) {
+                    this.PermissionOwnerRowDeleting(this, new PermissionOwnerRowChangeEvent(((PermissionOwnerRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemovePermissionOwnerRow(PermissionOwnerRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "PermissionOwnerDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class PermissionOwner_UserGroupDataTable : global::System.Data.TypedTableBase<PermissionOwner_UserGroupRow> {
+            
+            private global::System.Data.DataColumn columnPermissionOwnerId;
+            
+            private global::System.Data.DataColumn columnUserGroupId;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupDataTable() {
+                this.TableName = "PermissionOwner_UserGroup";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionOwner_UserGroupDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected PermissionOwner_UserGroupDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn PermissionOwnerIdColumn {
+                get {
+                    return this.columnPermissionOwnerId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn UserGroupIdColumn {
+                get {
+                    return this.columnUserGroupId;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow this[int index] {
+                get {
+                    return ((PermissionOwner_UserGroupRow)(this.Rows[index]));
+                }
+            }
+            
+            public event PermissionOwner_UserGroupRowChangeEventHandler PermissionOwner_UserGroupRowChanging;
+            
+            public event PermissionOwner_UserGroupRowChangeEventHandler PermissionOwner_UserGroupRowChanged;
+            
+            public event PermissionOwner_UserGroupRowChangeEventHandler PermissionOwner_UserGroupRowDeleting;
+            
+            public event PermissionOwner_UserGroupRowChangeEventHandler PermissionOwner_UserGroupRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddPermissionOwner_UserGroupRow(PermissionOwner_UserGroupRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow AddPermissionOwner_UserGroupRow(PermissionOwnerRow parentPermissionOwnerRowByR_44, UserGroupRow parentUserGroupRowByR_57) {
+                PermissionOwner_UserGroupRow rowPermissionOwner_UserGroupRow = ((PermissionOwner_UserGroupRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        null,
+                        null};
+                if ((parentPermissionOwnerRowByR_44 != null)) {
+                    columnValuesArray[0] = parentPermissionOwnerRowByR_44[0];
+                }
+                if ((parentUserGroupRowByR_57 != null)) {
+                    columnValuesArray[1] = parentUserGroupRowByR_57[0];
+                }
+                rowPermissionOwner_UserGroupRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowPermissionOwner_UserGroupRow);
+                return rowPermissionOwner_UserGroupRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow FindByPermissionOwnerIdUserGroupId(System.Guid PermissionOwnerId, System.Guid UserGroupId) {
+                return ((PermissionOwner_UserGroupRow)(this.Rows.Find(new object[] {
+                            PermissionOwnerId,
+                            UserGroupId})));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                PermissionOwner_UserGroupDataTable cln = ((PermissionOwner_UserGroupDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new PermissionOwner_UserGroupDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnPermissionOwnerId = base.Columns["PermissionOwnerId"];
+                this.columnUserGroupId = base.Columns["UserGroupId"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnPermissionOwnerId = new global::System.Data.DataColumn("PermissionOwnerId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnPermissionOwnerId);
+                this.columnUserGroupId = new global::System.Data.DataColumn("UserGroupId", typeof(global::System.Guid), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnUserGroupId);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] {
+                                this.columnPermissionOwnerId,
+                                this.columnUserGroupId}, true));
+                this.columnPermissionOwnerId.AllowDBNull = false;
+                this.columnUserGroupId.AllowDBNull = false;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow NewPermissionOwner_UserGroupRow() {
+                return ((PermissionOwner_UserGroupRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new PermissionOwner_UserGroupRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(PermissionOwner_UserGroupRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.PermissionOwner_UserGroupRowChanged != null)) {
+                    this.PermissionOwner_UserGroupRowChanged(this, new PermissionOwner_UserGroupRowChangeEvent(((PermissionOwner_UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.PermissionOwner_UserGroupRowChanging != null)) {
+                    this.PermissionOwner_UserGroupRowChanging(this, new PermissionOwner_UserGroupRowChangeEvent(((PermissionOwner_UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.PermissionOwner_UserGroupRowDeleted != null)) {
+                    this.PermissionOwner_UserGroupRowDeleted(this, new PermissionOwner_UserGroupRowChangeEvent(((PermissionOwner_UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.PermissionOwner_UserGroupRowDeleting != null)) {
+                    this.PermissionOwner_UserGroupRowDeleting(this, new PermissionOwner_UserGroupRowChangeEvent(((PermissionOwner_UserGroupRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemovePermissionOwner_UserGroupRow(PermissionOwner_UserGroupRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsSecurity ds = new dsSecurity();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "PermissionOwner_UserGroupDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class GrantedPermissionsRow : global::System.Data.DataRow {
+            
+            private GrantedPermissionsDataTable tableGrantedPermissions;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal GrantedPermissionsRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tableGrantedPermissions = ((GrantedPermissionsDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionId {
+                get {
+                    return ((global::System.Guid)(this[this.tableGrantedPermissions.PermissionIdColumn]));
+                }
+                set {
+                    this[this.tableGrantedPermissions.PermissionIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionOwnerId {
+                get {
+                    return ((global::System.Guid)(this[this.tableGrantedPermissions.PermissionOwnerIdColumn]));
+                }
+                set {
+                    this[this.tableGrantedPermissions.PermissionOwnerIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid EntityId {
+                get {
+                    return ((global::System.Guid)(this[this.tableGrantedPermissions.EntityIdColumn]));
+                }
+                set {
+                    this[this.tableGrantedPermissions.EntityIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow PermissionRow {
+                get {
+                    return ((PermissionRow)(this.GetParentRow(this.Table.ParentRelations["R_49"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["R_49"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow PermissionOwnerRow {
+                get {
+                    return ((PermissionOwnerRow)(this.GetParentRow(this.Table.ParentRelations["R_50"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["R_50"]);
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class UserGroupRow : global::System.Data.DataRow {
+            
+            private UserGroupDataTable tableUserGroup;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal UserGroupRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tableUserGroup = ((UserGroupDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionOwnerId {
+                get {
+                    return ((global::System.Guid)(this[this.tableUserGroup.PermissionOwnerIdColumn]));
+                }
+                set {
+                    this[this.tableUserGroup.PermissionOwnerIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow PermissionOwnerRow {
+                get {
+                    return ((PermissionOwnerRow)(this.GetParentRow(this.Table.ParentRelations["UserGroup_is_a_PermissionOwner"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["UserGroup_is_a_PermissionOwner"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow[] GetPermissionOwner_UserGroupRows() {
+                if ((this.Table.ChildRelations["R_57"] == null)) {
+                    return new PermissionOwner_UserGroupRow[0];
+                }
+                else {
+                    return ((PermissionOwner_UserGroupRow[])(base.GetChildRows(this.Table.ChildRelations["R_57"])));
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class HLUserRow : global::System.Data.DataRow {
+            
+            private HLUserDataTable tableHLUser;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal HLUserRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tableHLUser = ((HLUserDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionOwnerId {
+                get {
+                    return ((global::System.Guid)(this[this.tableHLUser.PermissionOwnerIdColumn]));
+                }
+                set {
+                    this[this.tableHLUser.PermissionOwnerIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Password {
+                get {
+                    try {
+                        return ((string)(this[this.tableHLUser.PasswordColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Password\' in table \'HLUser\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableHLUser.PasswordColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Login {
+                get {
+                    try {
+                        return ((string)(this[this.tableHLUser.LoginColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Login\' in table \'HLUser\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableHLUser.LoginColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string MailAddress {
+                get {
+                    try {
+                        return ((string)(this[this.tableHLUser.MailAddressColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'MailAddress\' in table \'HLUser\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableHLUser.MailAddressColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow PermissionOwnerRow {
+                get {
+                    return ((PermissionOwnerRow)(this.GetParentRow(this.Table.ParentRelations["User_is_a_PermissionOwner"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["User_is_a_PermissionOwner"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsPasswordNull() {
+                return this.IsNull(this.tableHLUser.PasswordColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetPasswordNull() {
+                this[this.tableHLUser.PasswordColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsLoginNull() {
+                return this.IsNull(this.tableHLUser.LoginColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetLoginNull() {
+                this[this.tableHLUser.LoginColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsMailAddressNull() {
+                return this.IsNull(this.tableHLUser.MailAddressColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetMailAddressNull() {
+                this[this.tableHLUser.MailAddressColumn] = global::System.Convert.DBNull;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class PermissionRow : global::System.Data.DataRow {
+            
+            private PermissionDataTable tablePermission;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tablePermission = ((PermissionDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionId {
+                get {
+                    return ((global::System.Guid)(this[this.tablePermission.PermissionIdColumn]));
+                }
+                set {
+                    this[this.tablePermission.PermissionIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Name {
+                get {
+                    try {
+                        return ((string)(this[this.tablePermission.NameColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'Permission\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePermission.NameColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Description {
+                get {
+                    try {
+                        return ((string)(this[this.tablePermission.DescriptionColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Description\' in table \'Permission\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePermission.DescriptionColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Plugin {
+                get {
+                    try {
+                        return ((string)(this[this.tablePermission.PluginColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Plugin\' in table \'Permission\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePermission.PluginColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNameNull() {
+                return this.IsNull(this.tablePermission.NameColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNameNull() {
+                this[this.tablePermission.NameColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsDescriptionNull() {
+                return this.IsNull(this.tablePermission.DescriptionColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetDescriptionNull() {
+                this[this.tablePermission.DescriptionColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsPluginNull() {
+                return this.IsNull(this.tablePermission.PluginColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetPluginNull() {
+                this[this.tablePermission.PluginColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow[] GetGrantedPermissionsRows() {
+                if ((this.Table.ChildRelations["R_49"] == null)) {
+                    return new GrantedPermissionsRow[0];
+                }
+                else {
+                    return ((GrantedPermissionsRow[])(base.GetChildRows(this.Table.ChildRelations["R_49"])));
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class PermissionOwnerRow : global::System.Data.DataRow {
+            
+            private PermissionOwnerDataTable tablePermissionOwner;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionOwnerRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tablePermissionOwner = ((PermissionOwnerDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionOwnerId {
+                get {
+                    return ((global::System.Guid)(this[this.tablePermissionOwner.PermissionOwnerIdColumn]));
+                }
+                set {
+                    this[this.tablePermissionOwner.PermissionOwnerIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Name {
+                get {
+                    try {
+                        return ((string)(this[this.tablePermissionOwner.NameColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'PermissionOwner\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePermissionOwner.NameColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNameNull() {
+                return this.IsNull(this.tablePermissionOwner.NameColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNameNull() {
+                this[this.tablePermissionOwner.NameColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow[] GetGrantedPermissionsRows() {
+                if ((this.Table.ChildRelations["R_50"] == null)) {
+                    return new GrantedPermissionsRow[0];
+                }
+                else {
+                    return ((GrantedPermissionsRow[])(base.GetChildRows(this.Table.ChildRelations["R_50"])));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow[] GetUserGroupRows() {
+                if ((this.Table.ChildRelations["UserGroup_is_a_PermissionOwner"] == null)) {
+                    return new UserGroupRow[0];
+                }
+                else {
+                    return ((UserGroupRow[])(base.GetChildRows(this.Table.ChildRelations["UserGroup_is_a_PermissionOwner"])));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow[] GetHLUserRows() {
+                if ((this.Table.ChildRelations["User_is_a_PermissionOwner"] == null)) {
+                    return new HLUserRow[0];
+                }
+                else {
+                    return ((HLUserRow[])(base.GetChildRows(this.Table.ChildRelations["User_is_a_PermissionOwner"])));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow[] GetPermissionOwner_UserGroupRows() {
+                if ((this.Table.ChildRelations["R_44"] == null)) {
+                    return new PermissionOwner_UserGroupRow[0];
+                }
+                else {
+                    return ((PermissionOwner_UserGroupRow[])(base.GetChildRows(this.Table.ChildRelations["R_44"])));
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class PermissionOwner_UserGroupRow : global::System.Data.DataRow {
+            
+            private PermissionOwner_UserGroupDataTable tablePermissionOwner_UserGroup;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PermissionOwner_UserGroupRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tablePermissionOwner_UserGroup = ((PermissionOwner_UserGroupDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid PermissionOwnerId {
+                get {
+                    return ((global::System.Guid)(this[this.tablePermissionOwner_UserGroup.PermissionOwnerIdColumn]));
+                }
+                set {
+                    this[this.tablePermissionOwner_UserGroup.PermissionOwnerIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.Guid UserGroupId {
+                get {
+                    return ((global::System.Guid)(this[this.tablePermissionOwner_UserGroup.UserGroupIdColumn]));
+                }
+                set {
+                    this[this.tablePermissionOwner_UserGroup.UserGroupIdColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow PermissionOwnerRow {
+                get {
+                    return ((PermissionOwnerRow)(this.GetParentRow(this.Table.ParentRelations["R_44"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["R_44"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow UserGroupRow {
+                get {
+                    return ((UserGroupRow)(this.GetParentRow(this.Table.ParentRelations["R_57"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["R_57"]);
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class GrantedPermissionsRowChangeEvent : global::System.EventArgs {
+            
+            private GrantedPermissionsRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRowChangeEvent(GrantedPermissionsRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public GrantedPermissionsRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class UserGroupRowChangeEvent : global::System.EventArgs {
+            
+            private UserGroupRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRowChangeEvent(UserGroupRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public UserGroupRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class HLUserRowChangeEvent : global::System.EventArgs {
+            
+            private HLUserRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRowChangeEvent(HLUserRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public HLUserRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class PermissionRowChangeEvent : global::System.EventArgs {
+            
+            private PermissionRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRowChangeEvent(PermissionRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class PermissionOwnerRowChangeEvent : global::System.EventArgs {
+            
+            private PermissionOwnerRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRowChangeEvent(PermissionOwnerRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwnerRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class PermissionOwner_UserGroupRowChangeEvent : global::System.EventArgs {
+            
+            private PermissionOwner_UserGroupRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRowChangeEvent(PermissionOwner_UserGroupRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PermissionOwner_UserGroupRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+    }
+}
+namespace HeuristicLab.Security.ADODataAccess.dsSecurityTableAdapters {
+    
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class GrantedPermissionsTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public GrantedPermissionsTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "GrantedPermissions";
+            tableMapping.ColumnMappings.Add("PermissionId", "PermissionId");
+            tableMapping.ColumnMappings.Add("PermissionOwnerId", "PermissionOwnerId");
+            tableMapping.ColumnMappings.Add("EntityId", "EntityId");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[GrantedPermissions] WHERE (([PermissionId] = @Original_Permiss" +
+                "ionId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId) AND ([EntityId] =" +
+                " @Original_EntityId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[GrantedPermissions] ([PermissionId], [PermissionOwnerId], [EntityId]) VALUES (@PermissionId, @PermissionOwnerId, @EntityId);
+SELECT PermissionId, PermissionOwnerId, EntityId FROM GrantedPermissions WHERE (EntityId = @EntityId) AND (PermissionId = @PermissionId) AND (PermissionOwnerId = @PermissionOwnerId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[GrantedPermissions] SET [PermissionId] = @PermissionId, [PermissionOwnerId] = @PermissionOwnerId, [EntityId] = @EntityId WHERE (([PermissionId] = @Original_PermissionId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId) AND ([EntityId] = @Original_EntityId));
+SELECT PermissionId, PermissionOwnerId, EntityId FROM GrantedPermissions WHERE (EntityId = @EntityId) AND (PermissionId = @PermissionId) AND (PermissionOwnerId = @PermissionOwnerId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM dbo.GrantedPermissions";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.GrantedPermissions WHERE EntityId = @EntityId";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", 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 dbo.GrantedPermissions WHERE PermissionId = @PermissionId";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT * FROM dbo.GrantedPermissions WHERE PermissionOwnerId = @PermissionOwnerId" +
+                "";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].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, "", "", ""));
+            this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[4].Connection = this.Connection;
+            this._commandCollection[4].CommandText = "SELECT * FROM dbo.GrantedPermissions WHERE PermissionId = @PermissionId AND Permi" +
+                "ssionOwnerId = @PermissionOwnerId AND EntityId = @EntityId";
+            this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[4].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, "", "", ""));
+            this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EntityId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "EntityId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.GrantedPermissionsDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.GrantedPermissionsDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsSecurity.GrantedPermissionsDataTable dataTable = new dsSecurity.GrantedPermissionsDataTable();
+            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 FillByEntityId(dsSecurity.GrantedPermissionsDataTable dataTable, System.Guid EntityId) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(EntityId));
+            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.GrantedPermissionsDataTable GetDataByEntityId(System.Guid EntityId) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(EntityId));
+            dsSecurity.GrantedPermissionsDataTable dataTable = new dsSecurity.GrantedPermissionsDataTable();
+            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 FillByPermissionId(dsSecurity.GrantedPermissionsDataTable dataTable, System.Guid PermissionId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            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.GrantedPermissionsDataTable GetDataByPermissionId(System.Guid PermissionId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            dsSecurity.GrantedPermissionsDataTable dataTable = new dsSecurity.GrantedPermissionsDataTable();
+            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 FillByPermissionOwnerId(dsSecurity.GrantedPermissionsDataTable dataTable, System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            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.GrantedPermissionsDataTable GetDataByPermissionOwnerId(System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            dsSecurity.GrantedPermissionsDataTable dataTable = new dsSecurity.GrantedPermissionsDataTable();
+            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 FillByPermissionPermissionOwnerEntityId(dsSecurity.GrantedPermissionsDataTable dataTable, System.Guid PermissionId, System.Guid PermissionOwnerId, System.Guid EntityId) {
+            this.Adapter.SelectCommand = this.CommandCollection[4];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[2].Value = ((System.Guid)(EntityId));
+            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.GrantedPermissionsDataTable GetDataByPermissionPermissionOwnerEntityId(System.Guid PermissionId, System.Guid PermissionOwnerId, System.Guid EntityId) {
+            this.Adapter.SelectCommand = this.CommandCollection[4];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[2].Value = ((System.Guid)(EntityId));
+            dsSecurity.GrantedPermissionsDataTable dataTable = new dsSecurity.GrantedPermissionsDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.GrantedPermissionsDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "GrantedPermissions");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_PermissionId, System.Guid Original_PermissionOwnerId, System.Guid Original_EntityId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_PermissionId));
+            this.Adapter.DeleteCommand.Parameters[1].Value = ((System.Guid)(Original_PermissionOwnerId));
+            this.Adapter.DeleteCommand.Parameters[2].Value = ((System.Guid)(Original_EntityId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid PermissionId, System.Guid PermissionOwnerId, System.Guid EntityId) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            this.Adapter.InsertCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.InsertCommand.Parameters[2].Value = ((System.Guid)(EntityId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid PermissionId, System.Guid PermissionOwnerId, System.Guid EntityId, System.Guid Original_PermissionId, System.Guid Original_PermissionOwnerId, System.Guid Original_EntityId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            this.Adapter.UpdateCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.UpdateCommand.Parameters[2].Value = ((System.Guid)(EntityId));
+            this.Adapter.UpdateCommand.Parameters[3].Value = ((System.Guid)(Original_PermissionId));
+            this.Adapter.UpdateCommand.Parameters[4].Value = ((System.Guid)(Original_PermissionOwnerId));
+            this.Adapter.UpdateCommand.Parameters[5].Value = ((System.Guid)(Original_EntityId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid Original_PermissionId, System.Guid Original_PermissionOwnerId, System.Guid Original_EntityId) {
+            return this.Update(Original_PermissionId, Original_PermissionOwnerId, Original_EntityId, Original_PermissionId, Original_PermissionOwnerId, Original_EntityId);
+        }
+    }
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class UserGroupTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public UserGroupTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "UserGroup";
+            tableMapping.ColumnMappings.Add("PermissionOwnerId", "PermissionOwnerId");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[UserGroup] WHERE (([PermissionOwnerId] = @Original_PermissionO" +
+                "wnerId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[UserGroup] ([PermissionOwnerId]) VALUES (@PermissionOwnerId);\r" +
+                "\nSELECT PermissionOwnerId FROM UserGroup WHERE (PermissionOwnerId = @PermissionO" +
+                "wnerId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[UserGroup] SET [PermissionOwnerId] = @PermissionOwnerId WHERE (([Pe" +
+                "rmissionOwnerId] = @Original_PermissionOwnerId));\r\nSELECT PermissionOwnerId FROM" +
+                " UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM dbo.UserGroup";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM dbo.UserGroup WHERE PermissionOwnerId = @Id";
+            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, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.UserGroupDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.UserGroupDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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 FillById(dsSecurity.UserGroupDataTable dataTable, System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            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 GetDataById(System.Guid Id) {
+            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);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.UserGroupDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "UserGroup");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_PermissionOwnerId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid PermissionOwnerId) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid PermissionOwnerId, System.Guid Original_PermissionOwnerId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.UpdateCommand.Parameters[1].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid Original_PermissionOwnerId) {
+            return this.Update(Original_PermissionOwnerId, Original_PermissionOwnerId);
+        }
+    }
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class HLUserTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public HLUserTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "HLUser";
+            tableMapping.ColumnMappings.Add("PermissionOwnerId", "PermissionOwnerId");
+            tableMapping.ColumnMappings.Add("Password", "Password");
+            tableMapping.ColumnMappings.Add("Login", "Login");
+            tableMapping.ColumnMappings.Add("MailAddress", "MailAddress");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [HLUser] WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = "INSERT INTO [HLUser] ([PermissionOwnerId], [Password], [Login], [MailAddress]) VA" +
+                "LUES (@PermissionOwnerId, @Password, @Login, @MailAddress);\r\nSELECT PermissionOw" +
+                "nerId, Password, Login, MailAddress FROM HLUser WHERE (PermissionOwnerId = @Perm" +
+                "issionOwnerId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Password", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Login", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Login", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MailAddress", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = @"UPDATE [HLUser] SET [PermissionOwnerId] = @PermissionOwnerId, [Password] = @Password, [Login] = @Login, [MailAddress] = @MailAddress WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT PermissionOwnerId, Password, Login, MailAddress FROM HLUser WHERE (PermissionOwnerId = @PermissionOwnerId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Password", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Password", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Login", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Login", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "MailAddress", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM HLUser";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT * FROM HLUser WHERE PermissionOwnerId = @Id";
+            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 HLUser WHERE Login = @Login";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Login", global::System.Data.SqlDbType.VarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "Login", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.HLUserDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.HLUserDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsSecurity.HLUserDataTable dataTable = new dsSecurity.HLUserDataTable();
+            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 FillById(dsSecurity.HLUserDataTable dataTable, System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            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.HLUserDataTable GetDataById(System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            dsSecurity.HLUserDataTable dataTable = new dsSecurity.HLUserDataTable();
+            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 FillByLogin(dsSecurity.HLUserDataTable dataTable, string Login) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Login == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Login));
+            }
+            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.HLUserDataTable GetDataByLogin(string Login) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Login == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Login));
+            }
+            dsSecurity.HLUserDataTable dataTable = new dsSecurity.HLUserDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.HLUserDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "HLUser");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_PermissionOwnerId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid PermissionOwnerId, string Password, string Login, string MailAddress) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            if ((Password == null)) {
+                this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Password));
+            }
+            if ((Login == null)) {
+                this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[2].Value = ((string)(Login));
+            }
+            if ((MailAddress == null)) {
+                this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[3].Value = ((string)(MailAddress));
+            }
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid PermissionOwnerId, string Password, string Login, string MailAddress, System.Guid Original_PermissionOwnerId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            if ((Password == null)) {
+                this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Password));
+            }
+            if ((Login == null)) {
+                this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Login));
+            }
+            if ((MailAddress == null)) {
+                this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(MailAddress));
+            }
+            this.Adapter.UpdateCommand.Parameters[4].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(string Password, string Login, string MailAddress, System.Guid Original_PermissionOwnerId) {
+            return this.Update(Original_PermissionOwnerId, Password, Login, MailAddress, Original_PermissionOwnerId);
+        }
+    }
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class PermissionTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public PermissionTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "Permission";
+            tableMapping.ColumnMappings.Add("PermissionId", "PermissionId");
+            tableMapping.ColumnMappings.Add("Name", "Name");
+            tableMapping.ColumnMappings.Add("Description", "Description");
+            tableMapping.ColumnMappings.Add("Plugin", "Plugin");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [Permission] WHERE (([PermissionId] = @Original_PermissionId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = "INSERT INTO [Permission] ([PermissionId], [Name], [Description], [Plugin]) VALUES" +
+                " (@PermissionId, @Name, @Description, @Plugin);\r\nSELECT PermissionId, Name, Desc" +
+                "ription, Plugin FROM Permission WHERE (PermissionId = @PermissionId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Plugin", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Plugin", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = @"UPDATE [Permission] SET [PermissionId] = @PermissionId, [Name] = @Name, [Description] = @Description, [Plugin] = @Plugin WHERE (([PermissionId] = @Original_PermissionId));
+SELECT PermissionId, Name, Description, Plugin FROM Permission WHERE (PermissionId = @PermissionId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Plugin", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Plugin", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM Permission";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT Description, Name, PermissionId, Plugin FROM Permission WHERE (PermissionI" +
+                "d = @Id)";
+            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, "PermissionId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.PermissionDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.PermissionDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsSecurity.PermissionDataTable dataTable = new dsSecurity.PermissionDataTable();
+            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 FillById(dsSecurity.PermissionDataTable dataTable, System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            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.PermissionDataTable GetDataById(System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            dsSecurity.PermissionDataTable dataTable = new dsSecurity.PermissionDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.PermissionDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "Permission");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_PermissionId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_PermissionId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid PermissionId, string Name, string Description, string Plugin) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            if ((Name == null)) {
+                this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Name));
+            }
+            if ((Description == null)) {
+                this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[2].Value = ((string)(Description));
+            }
+            if ((Plugin == null)) {
+                this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Plugin));
+            }
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid PermissionId, string Name, string Description, string Plugin, System.Guid Original_PermissionId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(PermissionId));
+            if ((Name == null)) {
+                this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Name));
+            }
+            if ((Description == null)) {
+                this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Description));
+            }
+            if ((Plugin == null)) {
+                this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Plugin));
+            }
+            this.Adapter.UpdateCommand.Parameters[4].Value = ((System.Guid)(Original_PermissionId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(string Name, string Description, string Plugin, System.Guid Original_PermissionId) {
+            return this.Update(Original_PermissionId, Name, Description, Plugin, Original_PermissionId);
+        }
+    }
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class PermissionOwnerTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public PermissionOwnerTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "PermissionOwner";
+            tableMapping.ColumnMappings.Add("PermissionOwnerId", "PermissionOwnerId");
+            tableMapping.ColumnMappings.Add("Name", "Name");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [PermissionOwner] WHERE (([PermissionOwnerId] = @Original_PermissionO" +
+                "wnerId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = "INSERT INTO [PermissionOwner] ([PermissionOwnerId], [Name]) VALUES (@PermissionOw" +
+                "nerId, @Name);\r\nSELECT PermissionOwnerId, Name FROM PermissionOwner WHERE (Permi" +
+                "ssionOwnerId = @PermissionOwnerId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = "UPDATE [PermissionOwner] SET [PermissionOwnerId] = @PermissionOwnerId, [Name] = @" +
+                "Name WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId));\r\nSELECT Permis" +
+                "sionOwnerId, Name FROM PermissionOwner WHERE (PermissionOwnerId = @PermissionOwn" +
+                "erId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM PermissionOwner";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT Name, PermissionOwnerId FROM PermissionOwner WHERE (PermissionOwnerId = @I" +
+                "d)";
+            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 Name, PermissionOwnerId FROM PermissionOwner WHERE (Name = @Name)";
+            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.PermissionOwnerDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.PermissionOwnerDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsSecurity.PermissionOwnerDataTable dataTable = new dsSecurity.PermissionOwnerDataTable();
+            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 FillById(dsSecurity.PermissionOwnerDataTable dataTable, System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            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.PermissionOwnerDataTable GetDataById(System.Guid Id) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(Id));
+            dsSecurity.PermissionOwnerDataTable dataTable = new dsSecurity.PermissionOwnerDataTable();
+            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 FillByName(dsSecurity.PermissionOwnerDataTable dataTable, string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
+            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.PermissionOwnerDataTable GetDataByName(string Name) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            if ((Name == null)) {
+                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
+            }
+            dsSecurity.PermissionOwnerDataTable dataTable = new dsSecurity.PermissionOwnerDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.PermissionOwnerDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "PermissionOwner");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_PermissionOwnerId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid PermissionOwnerId, string Name) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            if ((Name == null)) {
+                this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Name));
+            }
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid PermissionOwnerId, string Name, System.Guid Original_PermissionOwnerId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            if ((Name == null)) {
+                this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
+            }
+            else {
+                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Name));
+            }
+            this.Adapter.UpdateCommand.Parameters[2].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(string Name, System.Guid Original_PermissionOwnerId) {
+            return this.Update(Original_PermissionOwnerId, Name, Original_PermissionOwnerId);
+        }
+    }
+    
+    /// <summary>
+    ///Represents the connection and commands used to retrieve and save data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DataObjectAttribute(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
+        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+    public partial class PermissionOwner_UserGroupTableAdapter : global::System.ComponentModel.Component {
+        
+        private global::System.Data.SqlClient.SqlDataAdapter _adapter;
+        
+        private global::System.Data.SqlClient.SqlConnection _connection;
+        
+        private global::System.Data.SqlClient.SqlTransaction _transaction;
+        
+        private global::System.Data.SqlClient.SqlCommand[] _commandCollection;
+        
+        private bool _clearBeforeFill;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public PermissionOwner_UserGroupTableAdapter() {
+            this.ClearBeforeFill = true;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter {
+            get {
+                if ((this._adapter == null)) {
+                    this.InitAdapter();
+                }
+                return this._adapter;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlConnection Connection {
+            get {
+                if ((this._connection == null)) {
+                    this.InitConnection();
+                }
+                return this._connection;
+            }
+            set {
+                this._connection = value;
+                if ((this.Adapter.InsertCommand != null)) {
+                    this.Adapter.InsertCommand.Connection = value;
+                }
+                if ((this.Adapter.DeleteCommand != null)) {
+                    this.Adapter.DeleteCommand.Connection = value;
+                }
+                if ((this.Adapter.UpdateCommand != null)) {
+                    this.Adapter.UpdateCommand.Connection = value;
+                }
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    if ((this.CommandCollection[i] != null)) {
+                        ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
+                    }
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal global::System.Data.SqlClient.SqlTransaction Transaction {
+            get {
+                return this._transaction;
+            }
+            set {
+                this._transaction = value;
+                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
+                    this.CommandCollection[i].Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.DeleteCommand != null))) {
+                    this.Adapter.DeleteCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.InsertCommand != null))) {
+                    this.Adapter.InsertCommand.Transaction = this._transaction;
+                }
+                if (((this.Adapter != null) 
+                            && (this.Adapter.UpdateCommand != null))) {
+                    this.Adapter.UpdateCommand.Transaction = this._transaction;
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
+            get {
+                if ((this._commandCollection == null)) {
+                    this.InitCommandCollection();
+                }
+                return this._commandCollection;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool ClearBeforeFill {
+            get {
+                return this._clearBeforeFill;
+            }
+            set {
+                this._clearBeforeFill = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitAdapter() {
+            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
+            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
+            tableMapping.SourceTable = "Table";
+            tableMapping.DataSetTable = "PermissionOwner_UserGroup";
+            tableMapping.ColumnMappings.Add("PermissionOwnerId", "PermissionOwnerId");
+            tableMapping.ColumnMappings.Add("UserGroupId", "UserGroupId");
+            this._adapter.TableMappings.Add(tableMapping);
+            this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.DeleteCommand.Connection = this.Connection;
+            this._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[PermissionOwner_UserGroup] WHERE (([UserGroupId] = @Original_U" +
+                "serGroupId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId))";
+            this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.InsertCommand.Connection = this.Connection;
+            this._adapter.InsertCommand.CommandText = @"INSERT INTO [dbo].[PermissionOwner_UserGroup] ([UserGroupId], [PermissionOwnerId]) VALUES (@UserGroupId, @PermissionOwnerId);
+SELECT UserGroupId, PermissionOwnerId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)";
+            this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand();
+            this._adapter.UpdateCommand.Connection = this.Connection;
+            this._adapter.UpdateCommand.CommandText = @"UPDATE [dbo].[PermissionOwner_UserGroup] SET [UserGroupId] = @UserGroupId, [PermissionOwnerId] = @PermissionOwnerId WHERE (([UserGroupId] = @Original_UserGroupId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT UserGroupId, PermissionOwnerId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)";
+            this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+            this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PermissionOwnerId", global::System.Data.SqlDbType.UniqueIdentifier, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitConnection() {
+            this._connection = new global::System.Data.SqlClient.SqlConnection();
+            this._connection.ConnectionString = global::HeuristicLab.Security.ADODataAccess.Properties.Settings.Default.HeuristicLab_SecurityConnectionString;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitCommandCollection() {
+            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
+            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[0].Connection = this.Connection;
+            this._commandCollection[0].CommandText = "SELECT * FROM dbo.PermissionOwner_UserGroup";
+            this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[1].Connection = this.Connection;
+            this._commandCollection[1].CommandText = "SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (Permi" +
+                "ssionOwnerId = @PermissionOwnerId)";
+            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[1].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, "", "", ""));
+            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[2].Connection = this.Connection;
+            this._commandCollection[2].CommandText = "SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (Permi" +
+                "ssionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)";
+            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, "", "", ""));
+            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+            this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
+            this._commandCollection[3].Connection = this.Connection;
+            this._commandCollection[3].CommandText = "SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (UserG" +
+                "roupId = @UserGroupId)";
+            this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
+            this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserGroupId", global::System.Data.SqlDbType.UniqueIdentifier, 16, global::System.Data.ParameterDirection.Input, 0, 0, "UserGroupId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
+        public virtual int Fill(dsSecurity.PermissionOwner_UserGroupDataTable dataTable) {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            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, true)]
+        public virtual dsSecurity.PermissionOwner_UserGroupDataTable GetData() {
+            this.Adapter.SelectCommand = this.CommandCollection[0];
+            dsSecurity.PermissionOwner_UserGroupDataTable dataTable = new dsSecurity.PermissionOwner_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 FillByPermissionOwnerId(dsSecurity.PermissionOwner_UserGroupDataTable dataTable, System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            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.PermissionOwner_UserGroupDataTable GetDataByPermissionOwnerId(System.Guid PermissionOwnerId) {
+            this.Adapter.SelectCommand = this.CommandCollection[1];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            dsSecurity.PermissionOwner_UserGroupDataTable dataTable = new dsSecurity.PermissionOwner_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 FillByPermissionOwnerUserGroupId(dsSecurity.PermissionOwner_UserGroupDataTable dataTable, System.Guid PermissionOwnerId, System.Guid UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((System.Guid)(UserGroupId));
+            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.PermissionOwner_UserGroupDataTable GetDataByPermissionOwnerUserGroupId(System.Guid PermissionOwnerId, System.Guid UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[2];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.SelectCommand.Parameters[1].Value = ((System.Guid)(UserGroupId));
+            dsSecurity.PermissionOwner_UserGroupDataTable dataTable = new dsSecurity.PermissionOwner_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 FillByUserGroupId(dsSecurity.PermissionOwner_UserGroupDataTable dataTable, System.Guid UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(UserGroupId));
+            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.PermissionOwner_UserGroupDataTable GetDataByUserGroupId(System.Guid UserGroupId) {
+            this.Adapter.SelectCommand = this.CommandCollection[3];
+            this.Adapter.SelectCommand.Parameters[0].Value = ((System.Guid)(UserGroupId));
+            dsSecurity.PermissionOwner_UserGroupDataTable dataTable = new dsSecurity.PermissionOwner_UserGroupDataTable();
+            this.Adapter.Fill(dataTable);
+            return dataTable;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity.PermissionOwner_UserGroupDataTable dataTable) {
+            return this.Adapter.Update(dataTable);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(dsSecurity dataSet) {
+            return this.Adapter.Update(dataSet, "PermissionOwner_UserGroup");
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow dataRow) {
+            return this.Adapter.Update(new global::System.Data.DataRow[] {
+                        dataRow});
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        public virtual int Update(global::System.Data.DataRow[] dataRows) {
+            return this.Adapter.Update(dataRows);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
+        public virtual int Delete(System.Guid Original_UserGroupId, System.Guid Original_PermissionOwnerId) {
+            this.Adapter.DeleteCommand.Parameters[0].Value = ((System.Guid)(Original_UserGroupId));
+            this.Adapter.DeleteCommand.Parameters[1].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
+            if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.DeleteCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.DeleteCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
+        public virtual int Insert(System.Guid UserGroupId, System.Guid PermissionOwnerId) {
+            this.Adapter.InsertCommand.Parameters[0].Value = ((System.Guid)(UserGroupId));
+            this.Adapter.InsertCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
+            if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.InsertCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.InsertCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid UserGroupId, System.Guid PermissionOwnerId, System.Guid Original_UserGroupId, System.Guid Original_PermissionOwnerId) {
+            this.Adapter.UpdateCommand.Parameters[0].Value = ((System.Guid)(UserGroupId));
+            this.Adapter.UpdateCommand.Parameters[1].Value = ((System.Guid)(PermissionOwnerId));
+            this.Adapter.UpdateCommand.Parameters[2].Value = ((System.Guid)(Original_UserGroupId));
+            this.Adapter.UpdateCommand.Parameters[3].Value = ((System.Guid)(Original_PermissionOwnerId));
+            global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
+            if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) 
+                        != global::System.Data.ConnectionState.Open)) {
+                this.Adapter.UpdateCommand.Connection.Open();
+            }
+            try {
+                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
+                return returnValue;
+            }
+            finally {
+                if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+                    this.Adapter.UpdateCommand.Connection.Close();
+                }
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
+        public virtual int Update(System.Guid Original_UserGroupId, System.Guid Original_PermissionOwnerId) {
+            return this.Update(Original_UserGroupId, Original_PermissionOwnerId, Original_UserGroupId, Original_PermissionOwnerId);
+        }
+    }
+    
+    /// <summary>
+    ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
+        "esigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
+    public partial class TableAdapterManager : global::System.ComponentModel.Component {
+        
+        private UpdateOrderOption _updateOrder;
+        
+        private GrantedPermissionsTableAdapter _grantedPermissionsTableAdapter;
+        
+        private UserGroupTableAdapter _userGroupTableAdapter;
+        
+        private HLUserTableAdapter _hLUserTableAdapter;
+        
+        private PermissionTableAdapter _permissionTableAdapter;
+        
+        private PermissionOwnerTableAdapter _permissionOwnerTableAdapter;
+        
+        private PermissionOwner_UserGroupTableAdapter _permissionOwner_UserGroupTableAdapter;
+        
+        private bool _backupDataSetBeforeUpdate;
+        
+        private global::System.Data.IDbConnection _connection;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public UpdateOrderOption UpdateOrder {
+            get {
+                return this._updateOrder;
+            }
+            set {
+                this._updateOrder = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public GrantedPermissionsTableAdapter GrantedPermissionsTableAdapter {
+            get {
+                return this._grantedPermissionsTableAdapter;
+            }
+            set {
+                this._grantedPermissionsTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public UserGroupTableAdapter UserGroupTableAdapter {
+            get {
+                return this._userGroupTableAdapter;
+            }
+            set {
+                this._userGroupTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public HLUserTableAdapter HLUserTableAdapter {
+            get {
+                return this._hLUserTableAdapter;
+            }
+            set {
+                this._hLUserTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public PermissionTableAdapter PermissionTableAdapter {
+            get {
+                return this._permissionTableAdapter;
+            }
+            set {
+                this._permissionTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public PermissionOwnerTableAdapter PermissionOwnerTableAdapter {
+            get {
+                return this._permissionOwnerTableAdapter;
+            }
+            set {
+                this._permissionOwnerTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
+            "ft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +
+            "", "System.Drawing.Design.UITypeEditor")]
+        public PermissionOwner_UserGroupTableAdapter PermissionOwner_UserGroupTableAdapter {
+            get {
+                return this._permissionOwner_UserGroupTableAdapter;
+            }
+            set {
+                this._permissionOwner_UserGroupTableAdapter = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public bool BackupDataSetBeforeUpdate {
+            get {
+                return this._backupDataSetBeforeUpdate;
+            }
+            set {
+                this._backupDataSetBeforeUpdate = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        public global::System.Data.IDbConnection Connection {
+            get {
+                if ((this._connection != null)) {
+                    return this._connection;
+                }
+                if (((this._grantedPermissionsTableAdapter != null) 
+                            && (this._grantedPermissionsTableAdapter.Connection != null))) {
+                    return this._grantedPermissionsTableAdapter.Connection;
+                }
+                if (((this._userGroupTableAdapter != null) 
+                            && (this._userGroupTableAdapter.Connection != null))) {
+                    return this._userGroupTableAdapter.Connection;
+                }
+                if (((this._hLUserTableAdapter != null) 
+                            && (this._hLUserTableAdapter.Connection != null))) {
+                    return this._hLUserTableAdapter.Connection;
+                }
+                if (((this._permissionTableAdapter != null) 
+                            && (this._permissionTableAdapter.Connection != null))) {
+                    return this._permissionTableAdapter.Connection;
+                }
+                if (((this._permissionOwnerTableAdapter != null) 
+                            && (this._permissionOwnerTableAdapter.Connection != null))) {
+                    return this._permissionOwnerTableAdapter.Connection;
+                }
+                if (((this._permissionOwner_UserGroupTableAdapter != null) 
+                            && (this._permissionOwner_UserGroupTableAdapter.Connection != null))) {
+                    return this._permissionOwner_UserGroupTableAdapter.Connection;
+                }
+                return null;
+            }
+            set {
+                this._connection = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        public int TableAdapterInstanceCount {
+            get {
+                int count = 0;
+                if ((this._grantedPermissionsTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                if ((this._userGroupTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                if ((this._hLUserTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                if ((this._permissionTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                if ((this._permissionOwnerTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                    count = (count + 1);
+                }
+                return count;
+            }
+        }
+        
+        /// <summary>
+        ///Update rows in top-down order.
+        ///</summary>
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private int UpdateUpdatedRows(dsSecurity dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
+            int result = 0;
+            if ((this._permissionOwnerTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.PermissionOwner.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._permissionOwnerTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            if ((this._permissionTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.Permission.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._permissionTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            if ((this._userGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.UserGroup.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._userGroupTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.PermissionOwner_UserGroup.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._permissionOwner_UserGroupTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            if ((this._grantedPermissionsTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.GrantedPermissions.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._grantedPermissionsTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            if ((this._hLUserTableAdapter != null)) {
+                global::System.Data.DataRow[] updatedRows = dataSet.HLUser.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
+                updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
+                if (((updatedRows != null) 
+                            && (0 < updatedRows.Length))) {
+                    result = (result + this._hLUserTableAdapter.Update(updatedRows));
+                    allChangedRows.AddRange(updatedRows);
+                }
+            }
+            return result;
+        }
+        
+        /// <summary>
+        ///Insert rows in top-down order.
+        ///</summary>
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private int UpdateInsertedRows(dsSecurity dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
+            int result = 0;
+            if ((this._permissionOwnerTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.PermissionOwner.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._permissionOwnerTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            if ((this._permissionTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.Permission.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._permissionTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            if ((this._userGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.UserGroup.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._userGroupTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.PermissionOwner_UserGroup.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._permissionOwner_UserGroupTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            if ((this._grantedPermissionsTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.GrantedPermissions.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._grantedPermissionsTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            if ((this._hLUserTableAdapter != null)) {
+                global::System.Data.DataRow[] addedRows = dataSet.HLUser.Select(null, null, global::System.Data.DataViewRowState.Added);
+                if (((addedRows != null) 
+                            && (0 < addedRows.Length))) {
+                    result = (result + this._hLUserTableAdapter.Update(addedRows));
+                    allAddedRows.AddRange(addedRows);
+                }
+            }
+            return result;
+        }
+        
+        /// <summary>
+        ///Delete rows in bottom-up order.
+        ///</summary>
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private int UpdateDeletedRows(dsSecurity dataSet, global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows) {
+            int result = 0;
+            if ((this._hLUserTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.HLUser.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._hLUserTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            if ((this._grantedPermissionsTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.GrantedPermissions.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._grantedPermissionsTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.PermissionOwner_UserGroup.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._permissionOwner_UserGroupTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            if ((this._userGroupTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.UserGroup.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._userGroupTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            if ((this._permissionTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.Permission.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._permissionTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            if ((this._permissionOwnerTableAdapter != null)) {
+                global::System.Data.DataRow[] deletedRows = dataSet.PermissionOwner.Select(null, null, global::System.Data.DataViewRowState.Deleted);
+                if (((deletedRows != null) 
+                            && (0 < deletedRows.Length))) {
+                    result = (result + this._permissionOwnerTableAdapter.Update(deletedRows));
+                    allChangedRows.AddRange(deletedRows);
+                }
+            }
+            return result;
+        }
+        
+        /// <summary>
+        ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
+        ///</summary>
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows) {
+            if (((updatedRows == null) 
+                        || (updatedRows.Length < 1))) {
+                return updatedRows;
+            }
+            if (((allAddedRows == null) 
+                        || (allAddedRows.Count < 1))) {
+                return updatedRows;
+            }
+            global::System.Collections.Generic.List<global::System.Data.DataRow> realUpdatedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
+            for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
+                global::System.Data.DataRow row = updatedRows[i];
+                if ((allAddedRows.Contains(row) == false)) {
+                    realUpdatedRows.Add(row);
+                }
+            }
+            return realUpdatedRows.ToArray();
+        }
+        
+        /// <summary>
+        ///Update all changes to the dataset.
+        ///</summary>
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public virtual int UpdateAll(dsSecurity dataSet) {
+            if ((dataSet == null)) {
+                throw new global::System.ArgumentNullException("dataSet");
+            }
+            if ((dataSet.HasChanges() == false)) {
+                return 0;
+            }
+            if (((this._grantedPermissionsTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._grantedPermissionsTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            if (((this._userGroupTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._userGroupTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            if (((this._hLUserTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._hLUserTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            if (((this._permissionTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._permissionTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            if (((this._permissionOwnerTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._permissionOwnerTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            if (((this._permissionOwner_UserGroupTableAdapter != null) 
+                        && (this.MatchTableAdapterConnection(this._permissionOwner_UserGroupTableAdapter.Connection) == false))) {
+                throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" +
+                        "tring.");
+            }
+            global::System.Data.IDbConnection workConnection = this.Connection;
+            if ((workConnection == null)) {
+                throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
+                        "ger TableAdapter property to a valid TableAdapter instance.");
+            }
+            bool workConnOpened = false;
+            if (((workConnection.State & global::System.Data.ConnectionState.Broken) 
+                        == global::System.Data.ConnectionState.Broken)) {
+                workConnection.Close();
+            }
+            if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
+                workConnection.Open();
+                workConnOpened = true;
+            }
+            global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
+            if ((workTransaction == null)) {
+                throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
+                        "ctions or the current state is not allowing the transaction to begin.");
+            }
+            global::System.Collections.Generic.List<global::System.Data.DataRow> allChangedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
+            global::System.Collections.Generic.List<global::System.Data.DataRow> allAddedRows = new global::System.Collections.Generic.List<global::System.Data.DataRow>();
+            global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter> adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List<global::System.Data.Common.DataAdapter>();
+            global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary<object, global::System.Data.IDbConnection>();
+            int result = 0;
+            global::System.Data.DataSet backupDataSet = null;
+            if (this.BackupDataSetBeforeUpdate) {
+                backupDataSet = new global::System.Data.DataSet();
+                backupDataSet.Merge(dataSet);
+            }
+            try {
+                // ---- Prepare for update -----------
+                //
+                if ((this._grantedPermissionsTableAdapter != null)) {
+                    revertConnections.Add(this._grantedPermissionsTableAdapter, this._grantedPermissionsTableAdapter.Connection);
+                    this._grantedPermissionsTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._grantedPermissionsTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._grantedPermissionsTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._grantedPermissionsTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._grantedPermissionsTableAdapter.Adapter);
+                    }
+                }
+                if ((this._userGroupTableAdapter != null)) {
+                    revertConnections.Add(this._userGroupTableAdapter, this._userGroupTableAdapter.Connection);
+                    this._userGroupTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._userGroupTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._userGroupTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._userGroupTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._userGroupTableAdapter.Adapter);
+                    }
+                }
+                if ((this._hLUserTableAdapter != null)) {
+                    revertConnections.Add(this._hLUserTableAdapter, this._hLUserTableAdapter.Connection);
+                    this._hLUserTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._hLUserTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._hLUserTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._hLUserTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._hLUserTableAdapter.Adapter);
+                    }
+                }
+                if ((this._permissionTableAdapter != null)) {
+                    revertConnections.Add(this._permissionTableAdapter, this._permissionTableAdapter.Connection);
+                    this._permissionTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._permissionTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._permissionTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._permissionTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._permissionTableAdapter.Adapter);
+                    }
+                }
+                if ((this._permissionOwnerTableAdapter != null)) {
+                    revertConnections.Add(this._permissionOwnerTableAdapter, this._permissionOwnerTableAdapter.Connection);
+                    this._permissionOwnerTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._permissionOwnerTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._permissionOwnerTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._permissionOwnerTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._permissionOwnerTableAdapter.Adapter);
+                    }
+                }
+                if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                    revertConnections.Add(this._permissionOwner_UserGroupTableAdapter, this._permissionOwner_UserGroupTableAdapter.Connection);
+                    this._permissionOwner_UserGroupTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection));
+                    this._permissionOwner_UserGroupTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction));
+                    if (this._permissionOwner_UserGroupTableAdapter.Adapter.AcceptChangesDuringUpdate) {
+                        this._permissionOwner_UserGroupTableAdapter.Adapter.AcceptChangesDuringUpdate = false;
+                        adaptersWithAcceptChangesDuringUpdate.Add(this._permissionOwner_UserGroupTableAdapter.Adapter);
+                    }
+                }
+                // 
+                //---- Perform updates -----------
+                //
+                if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) {
+                    result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
+                    result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
+                }
+                else {
+                    result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
+                    result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
+                }
+                result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
+                // 
+                //---- Commit updates -----------
+                //
+                workTransaction.Commit();
+                if ((0 < allAddedRows.Count)) {
+                    global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
+                    allAddedRows.CopyTo(rows);
+                    for (int i = 0; (i < rows.Length); i = (i + 1)) {
+                        global::System.Data.DataRow row = rows[i];
+                        row.AcceptChanges();
+                    }
+                }
+                if ((0 < allChangedRows.Count)) {
+                    global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
+                    allChangedRows.CopyTo(rows);
+                    for (int i = 0; (i < rows.Length); i = (i + 1)) {
+                        global::System.Data.DataRow row = rows[i];
+                        row.AcceptChanges();
+                    }
+                }
+            }
+            catch (global::System.Exception ex) {
+                workTransaction.Rollback();
+                // ---- Restore the dataset -----------
+                if (this.BackupDataSetBeforeUpdate) {
+                    global::System.Diagnostics.Debug.Assert((backupDataSet != null));
+                    dataSet.Clear();
+                    dataSet.Merge(backupDataSet);
+                }
+                else {
+                    if ((0 < allAddedRows.Count)) {
+                        global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
+                        allAddedRows.CopyTo(rows);
+                        for (int i = 0; (i < rows.Length); i = (i + 1)) {
+                            global::System.Data.DataRow row = rows[i];
+                            row.AcceptChanges();
+                            row.SetAdded();
+                        }
+                    }
+                }
+                throw ex;
+            }
+            finally {
+                if (workConnOpened) {
+                    workConnection.Close();
+                }
+                if ((this._grantedPermissionsTableAdapter != null)) {
+                    this._grantedPermissionsTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._grantedPermissionsTableAdapter]));
+                    this._grantedPermissionsTableAdapter.Transaction = null;
+                }
+                if ((this._userGroupTableAdapter != null)) {
+                    this._userGroupTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._userGroupTableAdapter]));
+                    this._userGroupTableAdapter.Transaction = null;
+                }
+                if ((this._hLUserTableAdapter != null)) {
+                    this._hLUserTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._hLUserTableAdapter]));
+                    this._hLUserTableAdapter.Transaction = null;
+                }
+                if ((this._permissionTableAdapter != null)) {
+                    this._permissionTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._permissionTableAdapter]));
+                    this._permissionTableAdapter.Transaction = null;
+                }
+                if ((this._permissionOwnerTableAdapter != null)) {
+                    this._permissionOwnerTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._permissionOwnerTableAdapter]));
+                    this._permissionOwnerTableAdapter.Transaction = null;
+                }
+                if ((this._permissionOwner_UserGroupTableAdapter != null)) {
+                    this._permissionOwner_UserGroupTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._permissionOwner_UserGroupTableAdapter]));
+                    this._permissionOwner_UserGroupTableAdapter.Transaction = null;
+                }
+                if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) {
+                    global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
+                    adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
+                    for (int i = 0; (i < adapters.Length); i = (i + 1)) {
+                        global::System.Data.Common.DataAdapter adapter = adapters[i];
+                        adapter.AcceptChangesDuringUpdate = true;
+                    }
+                }
+            }
+            return result;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) {
+            global::System.Array.Sort<global::System.Data.DataRow>(rows, new SelfReferenceComparer(relation, childFirst));
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) {
+            if ((this._connection != null)) {
+                return true;
+            }
+            if (((this.Connection == null) 
+                        || (inputConnection == null))) {
+                return true;
+            }
+            if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) {
+                return true;
+            }
+            return false;
+        }
+        
+        /// <summary>
+        ///Update Order Option
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public enum UpdateOrderOption {
+            
+            InsertUpdateDelete = 0,
+            
+            UpdateInsertDelete = 1,
+        }
+        
+        /// <summary>
+        ///Used to sort self-referenced table's rows
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer<global::System.Data.DataRow> {
+            
+            private global::System.Data.DataRelation _relation;
+            
+            private int _childFirst;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) {
+                this._relation = relation;
+                if (childFirst) {
+                    this._childFirst = -1;
+                }
+                else {
+                    this._childFirst = 1;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private bool IsChildAndParent(global::System.Data.DataRow child, global::System.Data.DataRow parent) {
+                global::System.Diagnostics.Debug.Assert((child != null));
+                global::System.Diagnostics.Debug.Assert((parent != null));
+                global::System.Data.DataRow newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
+                for (
+                ; ((newParent != null) 
+                            && ((object.ReferenceEquals(newParent, child) == false) 
+                            && (object.ReferenceEquals(newParent, parent) == false))); 
+                ) {
+                    newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default);
+                }
+                if ((newParent == null)) {
+                    for (newParent = child.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); ((newParent != null) 
+                                && ((object.ReferenceEquals(newParent, child) == false) 
+                                && (object.ReferenceEquals(newParent, parent) == false))); 
+                    ) {
+                        newParent = newParent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original);
+                    }
+                }
+                if (object.ReferenceEquals(newParent, parent)) {
+                    return true;
+                }
+                return false;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) {
+                if (object.ReferenceEquals(row1, row2)) {
+                    return 0;
+                }
+                if ((row1 == null)) {
+                    return -1;
+                }
+                if ((row2 == null)) {
+                    return 1;
+                }
+
+                // Is row1 the child or grandchild of row2
+                if (this.IsChildAndParent(row1, row2)) {
+                    return this._childFirst;
+                }
+
+                // Is row2 the child or grandchild of row1
+                if (this.IsChildAndParent(row2, row1)) {
+                    return (-1 * this._childFirst);
+                }
+                return 0;
+            }
+        }
+    }
+}
+
+#pragma warning restore 1591
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.cs	(revision 4072)
@@ -0,0 +1,8 @@
+﻿namespace HeuristicLab.Security.ADODataAccess {
+    
+    
+    public partial class dsSecurity {
+      partial class PermissionOwner_UserGroupDataTable {
+      }
+    }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsc
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsc	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsc	(revision 4072)
@@ -0,0 +1,9 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<!--<autogenerated>
+     This code was generated by a tool.
+     Changes to this file may cause incorrect behavior and will be lost if
+     the code is regenerated.
+</autogenerated>-->
+<DataSetUISetting Version="1.00" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+  <TableUISettings />
+</DataSetUISetting>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsd
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsd	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xsd	(revision 4072)
@@ -0,0 +1,595 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<xs:schema id="dsSecurity" targetNamespace="http://tempuri.org/dsSecurity.xsd" xmlns:mstns="http://tempuri.org/dsSecurity.xsd" xmlns="http://tempuri.org/dsSecurity.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
+  <xs:annotation>
+    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
+      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+        <Connections>
+          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="HeuristicLab_SecurityConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="HeuristicLab_SecurityConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.HeuristicLab.Security.ADODataAccess.Properties.Settings.GlobalReference.Default.HeuristicLab_SecurityConnectionString" Provider="System.Data.SqlClient" />
+        </Connections>
+        <Tables>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="GrantedPermissionsTableAdapter" GeneratorDataComponentClassName="GrantedPermissionsTableAdapter" Name="GrantedPermissions" UserDataComponentName="GrantedPermissionsTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.GrantedPermissions" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [dbo].[GrantedPermissions] WHERE (([PermissionId] = @Original_PermissionId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId) AND ([EntityId] = @Original_EntityId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [dbo].[GrantedPermissions] ([PermissionId], [PermissionOwnerId], [EntityId]) VALUES (@PermissionId, @PermissionOwnerId, @EntityId);
+SELECT PermissionId, PermissionOwnerId, EntityId FROM GrantedPermissions WHERE (EntityId = @EntityId) AND (PermissionId = @PermissionId) AND (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.GrantedPermissions</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [dbo].[GrantedPermissions] SET [PermissionId] = @PermissionId, [PermissionOwnerId] = @PermissionOwnerId, [EntityId] = @EntityId WHERE (([PermissionId] = @Original_PermissionId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId) AND ([EntityId] = @Original_EntityId));
+SELECT PermissionId, PermissionOwnerId, EntityId FROM GrantedPermissions WHERE (EntityId = @EntityId) AND (PermissionId = @PermissionId) AND (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionId" DataSetColumn="PermissionId" />
+              <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
+              <Mapping SourceColumn="EntityId" DataSetColumn="EntityId" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.GrantedPermissions" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByEntityId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByEntityId" GeneratorSourceName="FillByEntityId" GetMethodModifier="Public" GetMethodName="GetDataByEntityId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByEntityId" UserSourceName="FillByEntityId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.GrantedPermissions WHERE EntityId = @EntityId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="EntityId" ColumnName="EntityId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.GrantedPermissions" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionId" GeneratorSourceName="FillByPermissionId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionId" UserSourceName="FillByPermissionId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.GrantedPermissions WHERE PermissionId = @PermissionId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionId" ColumnName="PermissionId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.GrantedPermissions" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionOwnerId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionOwnerId" GeneratorSourceName="FillByPermissionOwnerId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionOwnerId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionOwnerId" UserSourceName="FillByPermissionOwnerId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.GrantedPermissions WHERE PermissionOwnerId = @PermissionOwnerId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" 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>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.GrantedPermissions" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionPermissionOwnerEntityId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionPermissionOwnerEntityId" GeneratorSourceName="FillByPermissionPermissionOwnerEntityId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionPermissionOwnerEntityId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionPermissionOwnerEntityId" UserSourceName="FillByPermissionPermissionOwnerEntityId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.GrantedPermissions WHERE PermissionId = @PermissionId AND PermissionOwnerId = @PermissionOwnerId AND EntityId = @EntityId</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionId" ColumnName="PermissionId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="EntityId" ColumnName="EntityId" DataSourceName="[HeuristicLab.Security].dbo.GrantedPermissions" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@EntityId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="EntityId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
+          </TableAdapter>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="UserGroupTableAdapter" GeneratorDataComponentClassName="UserGroupTableAdapter" Name="UserGroup" UserDataComponentName="UserGroupTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [dbo].[UserGroup] WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [dbo].[UserGroup] ([PermissionOwnerId]) VALUES (@PermissionOwnerId);
+SELECT PermissionOwnerId FROM UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.UserGroup</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [dbo].[UserGroup] SET [PermissionOwnerId] = @PermissionOwnerId WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT PermissionOwnerId FROM UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.UserGroup WHERE PermissionOwnerId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.UserGroup" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </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>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="HLUserTableAdapter" GeneratorDataComponentClassName="HLUserTableAdapter" Name="HLUser" UserDataComponentName="HLUserTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.HLUser" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [HLUser] WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [HLUser] ([PermissionOwnerId], [Password], [Login], [MailAddress]) VALUES (@PermissionOwnerId, @Password, @Login, @MailAddress);
+SELECT PermissionOwnerId, Password, Login, MailAddress FROM HLUser WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Password" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Password" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Login" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Login" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MailAddress" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM HLUser</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [HLUser] SET [PermissionOwnerId] = @PermissionOwnerId, [Password] = @Password, [Login] = @Login, [MailAddress] = @MailAddress WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT PermissionOwnerId, Password, Login, MailAddress FROM HLUser WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Password" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Password" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Login" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Login" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MailAddress" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
+              <Mapping SourceColumn="Password" DataSetColumn="Password" />
+              <Mapping SourceColumn="Login" DataSetColumn="Login" />
+              <Mapping SourceColumn="MailAddress" DataSetColumn="MailAddress" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.HLUser" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM HLUser WHERE PermissionOwnerId = @Id</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.HLUser" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.HLUser" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByLogin" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByLogin" GeneratorSourceName="FillByLogin" GetMethodModifier="Public" GetMethodName="GetDataByLogin" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByLogin" UserSourceName="FillByLogin">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM HLUser WHERE Login = @Login</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Login" ColumnName="Login" DataSourceName="[HeuristicLab.Security].dbo.HLUser" DataTypeServer="varchar(MAX)" DbType="AnsiString" Direction="Input" ParameterName="@Login" Precision="0" ProviderType="VarChar" Scale="0" Size="2147483647" SourceColumn="Login" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
+          </TableAdapter>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PermissionTableAdapter" GeneratorDataComponentClassName="PermissionTableAdapter" Name="Permission" UserDataComponentName="PermissionTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.Permission" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [Permission] WHERE (([PermissionId] = @Original_PermissionId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [Permission] ([PermissionId], [Name], [Description], [Plugin]) VALUES (@PermissionId, @Name, @Description, @Plugin);
+SELECT PermissionId, Name, Description, Plugin FROM Permission WHERE (PermissionId = @PermissionId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Plugin" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Plugin" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM Permission</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [Permission] SET [PermissionId] = @PermissionId, [Name] = @Name, [Description] = @Description, [Plugin] = @Plugin WHERE (([PermissionId] = @Original_PermissionId));
+SELECT PermissionId, Name, Description, Plugin FROM Permission WHERE (PermissionId = @PermissionId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Plugin" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Plugin" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionId" DataSetColumn="PermissionId" />
+              <Mapping SourceColumn="Name" DataSetColumn="Name" />
+              <Mapping SourceColumn="Description" DataSetColumn="Description" />
+              <Mapping SourceColumn="Plugin" DataSetColumn="Plugin" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.Permission" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT Description, Name, PermissionId, Plugin FROM Permission WHERE (PermissionId = @Id)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionId" DataSourceName="[HeuristicLab.Security].dbo.Permission" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
+          </TableAdapter>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PermissionOwnerTableAdapter" GeneratorDataComponentClassName="PermissionOwnerTableAdapter" Name="PermissionOwner" UserDataComponentName="PermissionOwnerTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [PermissionOwner] WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [PermissionOwner] ([PermissionOwnerId], [Name]) VALUES (@PermissionOwnerId, @Name);
+SELECT PermissionOwnerId, Name FROM PermissionOwner WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM PermissionOwner</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [PermissionOwner] SET [PermissionOwnerId] = @PermissionOwnerId, [Name] = @Name WHERE (([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT PermissionOwnerId, Name FROM PermissionOwner WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
+              <Mapping SourceColumn="Name" DataSetColumn="Name" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillById" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataById" GeneratorSourceName="FillById" GetMethodModifier="Public" GetMethodName="GetDataById" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataById" UserSourceName="FillById">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT Name, PermissionOwnerId FROM PermissionOwner WHERE (PermissionOwnerId = @Id)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="Id" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@Id" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByName" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByName" GeneratorSourceName="FillByName" GetMethodModifier="Public" GetMethodName="GetDataByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByName" UserSourceName="FillByName">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT Name, PermissionOwnerId FROM PermissionOwner WHERE (Name = @Name)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="true" AutogeneratedName="Name" ColumnName="Name" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner" DataTypeServer="varchar(MAX)" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="2147483647" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
+          </TableAdapter>
+          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PermissionOwner_UserGroupTableAdapter" GeneratorDataComponentClassName="PermissionOwner_UserGroupTableAdapter" Name="PermissionOwner_UserGroup" UserDataComponentName="PermissionOwner_UserGroupTableAdapter">
+            <MainSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
+                <DeleteCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>DELETE FROM [dbo].[PermissionOwner_UserGroup] WHERE (([UserGroupId] = @Original_UserGroupId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId))</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </DeleteCommand>
+                <InsertCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>INSERT INTO [dbo].[PermissionOwner_UserGroup] ([UserGroupId], [PermissionOwnerId]) VALUES (@UserGroupId, @PermissionOwnerId);
+SELECT UserGroupId, PermissionOwnerId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </InsertCommand>
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT * FROM dbo.PermissionOwner_UserGroup</CommandText>
+                    <Parameters />
+                  </DbCommand>
+                </SelectCommand>
+                <UpdateCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="false">
+                    <CommandText>UPDATE [dbo].[PermissionOwner_UserGroup] SET [UserGroupId] = @UserGroupId, [PermissionOwnerId] = @PermissionOwnerId WHERE (([UserGroupId] = @Original_UserGroupId) AND ([PermissionOwnerId] = @Original_PermissionOwnerId));
+SELECT UserGroupId, PermissionOwnerId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Original" />
+                    </Parameters>
+                  </DbCommand>
+                </UpdateCommand>
+              </DbSource>
+            </MainSource>
+            <Mappings>
+              <Mapping SourceColumn="PermissionOwnerId" DataSetColumn="PermissionOwnerId" />
+              <Mapping SourceColumn="UserGroupId" DataSetColumn="UserGroupId" />
+            </Mappings>
+            <Sources>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionOwnerId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionOwnerId" GeneratorSourceName="FillByPermissionOwnerId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionOwnerId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionOwnerId" UserSourceName="FillByPermissionOwnerId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner_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>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByPermissionOwnerUserGroupId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByPermissionOwnerUserGroupId" GeneratorSourceName="FillByPermissionOwnerUserGroupId" GetMethodModifier="Public" GetMethodName="GetDataByPermissionOwnerUserGroupId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByPermissionOwnerUserGroupId" UserSourceName="FillByPermissionOwnerUserGroupId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (PermissionOwnerId = @PermissionOwnerId) AND (UserGroupId = @UserGroupId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="PermissionOwnerId" ColumnName="PermissionOwnerId" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@PermissionOwnerId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="PermissionOwnerId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                      <Parameter AllowDbNull="false" AutogeneratedName="UserGroupId" ColumnName="UserGroupId" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+              <DbSource ConnectionRef="HeuristicLab_SecurityConnectionString (Settings)" DbObjectName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByUserGroupId" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByUserGroupId" GeneratorSourceName="FillByUserGroupId" GetMethodModifier="Public" GetMethodName="GetDataByUserGroupId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByUserGroupId" UserSourceName="FillByUserGroupId">
+                <SelectCommand>
+                  <DbCommand CommandType="Text" ModifiedByUser="true">
+                    <CommandText>SELECT PermissionOwnerId, UserGroupId FROM PermissionOwner_UserGroup WHERE (UserGroupId = @UserGroupId)</CommandText>
+                    <Parameters>
+                      <Parameter AllowDbNull="false" AutogeneratedName="UserGroupId" ColumnName="UserGroupId" DataSourceName="[HeuristicLab.Security].dbo.PermissionOwner_UserGroup" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@UserGroupId" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="UserGroupId" SourceColumnNullMapping="false" SourceVersion="Current" />
+                    </Parameters>
+                  </DbCommand>
+                </SelectCommand>
+              </DbSource>
+            </Sources>
+          </TableAdapter>
+        </Tables>
+        <Sources />
+      </DataSource>
+    </xs:appinfo>
+  </xs:annotation>
+  <xs:element name="dsSecurity" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dsSecurity" msprop:Generator_DataSetName="dsSecurity" msprop:EnableTableAdapterManager="true">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="GrantedPermissions" msprop:Generator_UserTableName="GrantedPermissions" msprop:Generator_RowDeletedName="GrantedPermissionsRowDeleted" msprop:Generator_RowChangedName="GrantedPermissionsRowChanged" msprop:Generator_RowClassName="GrantedPermissionsRow" msprop:Generator_RowChangingName="GrantedPermissionsRowChanging" msprop:Generator_RowEvArgName="GrantedPermissionsRowChangeEvent" msprop:Generator_RowEvHandlerName="GrantedPermissionsRowChangeEventHandler" msprop:Generator_TableClassName="GrantedPermissionsDataTable" msprop:Generator_TableVarName="tableGrantedPermissions" msprop:Generator_RowDeletingName="GrantedPermissionsRowDeleting" msprop:Generator_TablePropName="GrantedPermissions">
+          <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_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>
+        </xs:element>
+        <xs:element name="UserGroup" msprop:Generator_UserTableName="UserGroup" msprop:Generator_RowDeletedName="UserGroupRowDeleted" msprop:Generator_RowChangedName="UserGroupRowChanged" msprop:Generator_RowClassName="UserGroupRow" msprop:Generator_RowChangingName="UserGroupRowChanging" msprop:Generator_RowEvArgName="UserGroupRowChangeEvent" msprop:Generator_RowEvHandlerName="UserGroupRowChangeEventHandler" msprop:Generator_TableClassName="UserGroupDataTable" msprop:Generator_TableVarName="tableUserGroup" msprop:Generator_RowDeletingName="UserGroupRowDeleting" msprop:Generator_TablePropName="UserGroup">
+          <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_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:string" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="HLUser" msprop:Generator_UserTableName="HLUser" msprop:Generator_RowDeletedName="HLUserRowDeleted" msprop:Generator_RowChangedName="HLUserRowChanged" msprop:Generator_RowClassName="HLUserRow" msprop:Generator_RowChangingName="HLUserRowChanging" msprop:Generator_RowEvArgName="HLUserRowChangeEvent" msprop:Generator_RowEvHandlerName="HLUserRowChangeEventHandler" msprop:Generator_TableClassName="HLUserDataTable" msprop:Generator_TableVarName="tableHLUser" msprop:Generator_RowDeletingName="HLUserRowDeleting" msprop:Generator_TablePropName="HLUser">
+          <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_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">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Permission" msprop:Generator_UserTableName="Permission" msprop:Generator_RowDeletedName="PermissionRowDeleted" msprop:Generator_RowChangedName="PermissionRowChanged" msprop:Generator_RowClassName="PermissionRow" msprop:Generator_RowChangingName="PermissionRowChanging" msprop:Generator_RowEvArgName="PermissionRowChangeEvent" msprop:Generator_RowEvHandlerName="PermissionRowChangeEventHandler" msprop:Generator_TableClassName="PermissionDataTable" msprop:Generator_TableVarName="tablePermission" msprop:Generator_RowDeletingName="PermissionRowDeleting" msprop:Generator_TablePropName="Permission">
+          <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_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">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="PermissionOwner" msprop:Generator_UserTableName="PermissionOwner" msprop:Generator_RowDeletedName="PermissionOwnerRowDeleted" msprop:Generator_RowChangedName="PermissionOwnerRowChanged" msprop:Generator_RowClassName="PermissionOwnerRow" msprop:Generator_RowChangingName="PermissionOwnerRowChanging" msprop:Generator_RowEvArgName="PermissionOwnerRowChangeEvent" msprop:Generator_RowEvHandlerName="PermissionOwnerRowChangeEventHandler" msprop:Generator_TableClassName="PermissionOwnerDataTable" msprop:Generator_TableVarName="tablePermissionOwner" msprop:Generator_RowDeletingName="PermissionOwnerRowDeleting" msprop:Generator_TablePropName="PermissionOwner">
+          <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_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">
+                    <xs:maxLength value="2147483647" />
+                  </xs:restriction>
+                </xs:simpleType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="PermissionOwner_UserGroup" msprop:Generator_UserTableName="PermissionOwner_UserGroup" msprop:Generator_RowDeletedName="PermissionOwner_UserGroupRowDeleted" msprop:Generator_RowChangedName="PermissionOwner_UserGroupRowChanged" msprop:Generator_RowClassName="PermissionOwner_UserGroupRow" msprop:Generator_RowChangingName="PermissionOwner_UserGroupRowChanging" msprop:Generator_RowEvArgName="PermissionOwner_UserGroupRowChangeEvent" msprop:Generator_RowEvHandlerName="PermissionOwner_UserGroupRowChangeEventHandler" msprop:Generator_TableClassName="PermissionOwner_UserGroupDataTable" msprop:Generator_TableVarName="tablePermissionOwner_UserGroup" msprop:Generator_RowDeletingName="PermissionOwner_UserGroupRowDeleting" msprop:Generator_TablePropName="PermissionOwner_UserGroup">
+          <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_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>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:GrantedPermissions" />
+      <xs:field xpath="mstns:PermissionId" />
+      <xs:field xpath="mstns:PermissionOwnerId" />
+      <xs:field xpath="mstns:EntityId" />
+    </xs:unique>
+    <xs:unique name="UserGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:UserGroup" />
+      <xs:field xpath="mstns:PermissionOwnerId" />
+    </xs:unique>
+    <xs:unique name="HLUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:HLUser" />
+      <xs:field xpath="mstns:PermissionOwnerId" />
+    </xs:unique>
+    <xs:unique name="Permission_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:Permission" />
+      <xs:field xpath="mstns:PermissionId" />
+    </xs:unique>
+    <xs:unique name="PermissionOwner_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:PermissionOwner" />
+      <xs:field xpath="mstns:PermissionOwnerId" />
+    </xs:unique>
+    <xs:unique name="PermissionOwner_UserGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//mstns:PermissionOwner_UserGroup" />
+      <xs:field xpath="mstns:PermissionOwnerId" />
+      <xs:field xpath="mstns:UserGroupId" />
+    </xs:unique>
+  </xs:element>
+  <xs:annotation>
+    <xs:appinfo>
+      <msdata:Relationship name="R_49" msdata:parent="Permission" msdata:child="GrantedPermissions" msdata:parentkey="PermissionId" msdata:childkey="PermissionId" msprop:Generator_UserRelationName="R_49" msprop:Generator_RelationVarName="relationR_49" msprop:Generator_UserChildTable="GrantedPermissions" msprop:Generator_UserParentTable="Permission" msprop:Generator_ParentPropName="PermissionRow" msprop:Generator_ChildPropName="GetGrantedPermissionsRows" />
+      <msdata:Relationship name="R_50" msdata:parent="PermissionOwner" msdata:child="GrantedPermissions" msdata:parentkey="PermissionOwnerId" msdata:childkey="PermissionOwnerId" msprop:Generator_UserRelationName="R_50" msprop:Generator_RelationVarName="relationR_50" msprop:Generator_UserChildTable="GrantedPermissions" msprop:Generator_UserParentTable="PermissionOwner" msprop:Generator_ParentPropName="PermissionOwnerRow" msprop:Generator_ChildPropName="GetGrantedPermissionsRows" />
+      <msdata:Relationship name="UserGroup_is_a_PermissionOwner" msdata:parent="PermissionOwner" msdata:child="UserGroup" msdata:parentkey="PermissionOwnerId" msdata:childkey="PermissionOwnerId" msprop:Generator_UserRelationName="UserGroup_is_a_PermissionOwner" msprop:Generator_RelationVarName="relationUserGroup_is_a_PermissionOwner" msprop:Generator_UserChildTable="UserGroup" msprop:Generator_UserParentTable="PermissionOwner" msprop:Generator_ParentPropName="PermissionOwnerRow" msprop:Generator_ChildPropName="GetUserGroupRows" />
+      <msdata:Relationship name="User_is_a_PermissionOwner" msdata:parent="PermissionOwner" msdata:child="HLUser" msdata:parentkey="PermissionOwnerId" msdata:childkey="PermissionOwnerId" msprop:Generator_UserRelationName="User_is_a_PermissionOwner" msprop:Generator_RelationVarName="relationUser_is_a_PermissionOwner" msprop:Generator_UserChildTable="HLUser" msprop:Generator_UserParentTable="PermissionOwner" msprop:Generator_ParentPropName="PermissionOwnerRow" msprop:Generator_ChildPropName="GetHLUserRows" />
+      <msdata:Relationship name="R_44" msdata:parent="PermissionOwner" msdata:child="PermissionOwner_UserGroup" msdata:parentkey="PermissionOwnerId" msdata:childkey="PermissionOwnerId" msprop:Generator_UserRelationName="R_44" msprop:Generator_RelationVarName="relationR_44" msprop:Generator_UserChildTable="PermissionOwner_UserGroup" msprop:Generator_UserParentTable="PermissionOwner" msprop:Generator_ParentPropName="PermissionOwnerRow" msprop:Generator_ChildPropName="GetPermissionOwner_UserGroupRows" />
+      <msdata:Relationship name="R_57" msdata:parent="UserGroup" msdata:child="PermissionOwner_UserGroup" msdata:parentkey="PermissionOwnerId" msdata:childkey="UserGroupId" msprop:Generator_UserRelationName="R_57" msprop:Generator_RelationVarName="relationR_57" msprop:Generator_UserChildTable="PermissionOwner_UserGroup" msprop:Generator_UserParentTable="UserGroup" msprop:Generator_ParentPropName="UserGroupRow" msprop:Generator_ChildPropName="GetPermissionOwner_UserGroupRows" />
+    </xs:appinfo>
+  </xs:annotation>
+</xs:schema>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xss
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xss	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.ADODataAccess/3.3/dsSecurity.xss	(revision 4072)
@@ -0,0 +1,102 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<!--<autogenerated>
+     This code was generated by a tool to store the dataset designer's layout information.
+     Changes to this file may cause incorrect behavior and will be lost if
+     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="64" 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="123" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="42" />
+    <Shape ID="DesignTable:HLUser" ZOrder="3" X="577" Y="484" Height="156" Width="182" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="92" />
+    <Shape ID="DesignTable:Permission" ZOrder="4" X="292" Y="192" Height="156" Width="204" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="92" />
+    <Shape ID="DesignTable:PermissionOwner" ZOrder="2" X="600" Y="61" Height="139" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+    <Shape ID="DesignTable:PermissionOwner_UserGroup" ZOrder="1" X="860" Y="455" Height="156" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
+  </Shapes>
+  <Connectors>
+    <Connector ID="DesignRelation:R_49" ZOrder="7" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>394</X>
+          <Y>348</Y>
+        </Point>
+        <Point>
+          <X>394</X>
+          <Y>438</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+    <Connector ID="DesignRelation:R_50" ZOrder="12" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>628</X>
+          <Y>200</Y>
+        </Point>
+        <Point>
+          <X>628</X>
+          <Y>455</Y>
+        </Point>
+        <Point>
+          <X>541</X>
+          <Y>455</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+    <Connector ID="DesignRelation:UserGroup_is_a_PermissionOwner" ZOrder="5" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>842</X>
+          <Y>112</Y>
+        </Point>
+        <Point>
+          <X>1026</X>
+          <Y>112</Y>
+        </Point>
+        <Point>
+          <X>1026</X>
+          <Y>238</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+    <Connector ID="DesignRelation:User_is_a_PermissionOwner" ZOrder="11" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>706</X>
+          <Y>200</Y>
+        </Point>
+        <Point>
+          <X>706</X>
+          <Y>484</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+    <Connector ID="DesignRelation:R_44" ZOrder="6" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>817</X>
+          <Y>200</Y>
+        </Point>
+        <Point>
+          <X>817</X>
+          <Y>472</Y>
+        </Point>
+        <Point>
+          <X>860</X>
+          <Y>472</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+    <Connector ID="DesignRelation:R_57" ZOrder="10" LineWidth="11">
+      <RoutePoints>
+        <Point>
+          <X>1024</X>
+          <Y>361</Y>
+        </Point>
+        <Point>
+          <X>1024</X>
+          <Y>455</Y>
+        </Point>
+      </RoutePoints>
+    </Connector>
+  </Connectors>
+</DiagramLayout>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/GrantedPermission.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/GrantedPermission.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/GrantedPermission.cs	(revision 4072)
@@ -0,0 +1,39 @@
+﻿#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 System.Runtime.Serialization;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.Contracts.BusinessObjects {
+  
+  [DataContract]
+  public class GrantedPermission {    
+    [DataMember]
+    public Guid PermissionId { get; set; }
+    [DataMember]
+    public Guid EntityId { get; set; }
+    [DataMember]
+    public Guid PermissionOwnerId { get; set; }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/Permission.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/Permission.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/Permission.cs	(revision 4072)
@@ -0,0 +1,38 @@
+﻿#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 System.Runtime.Serialization;
+
+namespace HeuristicLab.Security.Contracts.BusinessObjects {
+
+  [DataContract]
+  public class Permission: PersistableObject {
+    [DataMember]
+    public String Description { get; set; }
+    [DataMember]
+    public String Name { get; set; }
+    [DataMember]
+    public String Plugin { get; set; }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PermissionOwner.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PermissionOwner.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PermissionOwner.cs	(revision 4072)
@@ -0,0 +1,37 @@
+﻿#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 System.Runtime.Serialization;
+
+namespace HeuristicLab.Security.Contracts.BusinessObjects {
+
+  [DataContract]
+  [KnownType(typeof(User))]
+  [KnownType(typeof(UserGroup))]
+  public class PermissionOwner: PersistableObject {
+    [DataMember]
+    public string Name { get; set; }
+
+ }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PersistableObject.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PersistableObject.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/PersistableObject.cs	(revision 4072)
@@ -0,0 +1,46 @@
+﻿#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 System.Runtime.Serialization;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.Contracts {
+  [DataContract]
+  public class PersistableObject: IPersistableObject {
+    [DataMember]
+    public Guid Id { get; set; }
+
+    public override bool Equals(object obj) {
+      if (obj is PersistableObject)
+        return this.Id.Equals(
+          (obj as PersistableObject).Id);
+      else
+        return base.Equals(obj);
+    }
+
+    public override int GetHashCode() {
+      return this.Id.GetHashCode();
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/User.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/User.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/User.cs	(revision 4072)
@@ -0,0 +1,80 @@
+﻿#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 System.Runtime.Serialization;
+using System.Security.Cryptography;
+
+namespace HeuristicLab.Security.Contracts.BusinessObjects {
+
+  [DataContract]
+  public class User : PermissionOwner {
+
+    [DataMember]
+    public String Login { get; set; }
+
+    private String password;
+    
+    [DataMember]
+    public String Password {
+      get {
+        return this.password;
+      }
+      protected set {
+        this.password = value;
+      }
+    }
+
+    [DataMember]
+    public String MailAddress { get; set; }
+
+    public void SetPlainPassword(String password) {
+      this.password = password;
+    }
+
+    public void SetHashedPassword(String password) {
+      this.password = getMd5Hash(password);
+    }
+
+    private static string getMd5Hash(string input) {
+      // Create a new instance of the MD5CryptoServiceProvider object.
+      MD5 md5Hasher = MD5.Create();
+
+      // Convert the input string to a byte array and compute the hash.
+      byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
+
+      // Create a new Stringbuilder to collect the bytes
+      // and create a string.
+      StringBuilder sBuilder = new StringBuilder();
+
+      // Loop through each byte of the hashed data 
+      // and format each one as a hexadecimal string.
+      for (int i = 0; i < data.Length; i++) {
+        sBuilder.Append(data[i].ToString("x2"));
+      }
+
+      // Return the hexadecimal string.
+      return sBuilder.ToString();
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/UserGroup.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/UserGroup.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/BusinessObjects/UserGroup.cs	(revision 4072)
@@ -0,0 +1,38 @@
+﻿#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 System.Runtime.Serialization;
+
+namespace HeuristicLab.Security.Contracts.BusinessObjects {
+
+  [DataContract]
+  public class UserGroup : PermissionOwner {
+    [DataMember]
+    public List<PermissionOwner> Members { get; set; }
+
+    public UserGroup() {
+      Members = new List<PermissionOwner>();
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/HeuristicLab.Security.Contracts-3.2.csproj
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/HeuristicLab.Security.Contracts-3.2.csproj	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/HeuristicLab.Security.Contracts-3.2.csproj	(revision 4072)
@@ -0,0 +1,122 @@
+﻿<?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>{D59E852C-F205-4647-8C05-EB9ED1CF44E9}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Security.Contracts</RootNamespace>
+    <AssemblyName>HeuristicLab.Security.Contracts-3.2</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <StartupObject>
+    </StartupObject>
+    <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>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <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>
+  -->
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="BusinessObjects\GrantedPermission.cs" />
+    <Compile Include="BusinessObjects\Permission.cs" />
+    <Compile Include="BusinessObjects\PermissionOwner.cs" />
+    <Compile Include="BusinessObjects\User.cs" />
+    <Compile Include="BusinessObjects\UserGroup.cs" />
+    <Compile Include="BusinessObjects\PersistableObject.cs" />
+    <Compile Include="SecurityContractsPlugin.cs" />
+    <Compile Include="Interfaces\IPermissionManager.cs" />
+    <Compile Include="Interfaces\ISecurityManager.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Runtime.Serialization">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.2\HeuristicLab.DataAccess-3.2.csproj">
+      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
+      <Name>HeuristicLab.DataAccess-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+</Project>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/IPermissionManager.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/IPermissionManager.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/IPermissionManager.cs	(revision 4072)
@@ -0,0 +1,25 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Text;
+using System.ServiceModel;
+
+namespace HeuristicLab.Security.Contracts.Interfaces {
+
+  [ServiceContract]
+  public interface IPermissionManager  {
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    Guid Authenticate(String userName, String password);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool CheckPermission(Guid sessionId, Guid permissionId,
+      Guid enitityId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    void EndSession(Guid sessionId);
+
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/ISecurityManager.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/ISecurityManager.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Interfaces/ISecurityManager.cs	(revision 4072)
@@ -0,0 +1,92 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Text;
+using System.ServiceModel;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+
+namespace HeuristicLab.Security.Contracts.Interfaces {
+
+  [ServiceContract]
+  public interface ISecurityManager {
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    Permission AddPermission(Permission permission);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool RemovePermission(Guid permissionId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    Permission UpdatePermission(Permission permission);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    User AddNewUser(User user);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool RemoveUser(Guid userId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    User UpdateUser(User user);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    ICollection<User> GetAllUsers();
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    User GetUserByName(string name);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    User GetUserByLogin(string login);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    UserGroup AddNewUserGroup(UserGroup group);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool RemoveUserGroup(Guid userGroupId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    UserGroup UpdateUserGroup(UserGroup group);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    ICollection<UserGroup> GetAllUserGroups();
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    UserGroup GetUserGroupByName(string name);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    PermissionOwner UpdatePermissionOwner(PermissionOwner permissionOwner);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool AddPermissionOwnerToGroup(Guid userGroupId, Guid permissionOwnerId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool RemovePermissionOwnerFromGroup(Guid userGroupId, Guid permissionOwnerId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool GrantPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    Permission GetPermissionById(Guid permissionId);
+
+    [OperationContract]
+    [FaultContractAttribute(typeof(CommunicationException))]
+    bool RevokePermission(Guid permissionOwnerId, Guid permissionId, Guid entityId);
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Properties/AssemblyInfo.frame	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/Properties/AssemblyInfo.frame	(revision 4072)
@@ -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.Contracts")]
+[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("9A54C04F-E1B3-490a-AB49-D3F42CAAB4F1")]
+
+// 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/SecurityContractsPlugin.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/SecurityContractsPlugin.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Contracts/3.3/SecurityContractsPlugin.cs	(revision 4072)
@@ -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.Contracts {
+  [Plugin("HeuristicLab.Security.Contracts-3.2")]
+  [PluginFile("HeuristicLab.Security.Contracts-3.2.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core-3.2")]
+  public class SecurityContractsPlugin : PluginBase {
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/HeuristicLab.Security.Core-3.2.csproj
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/HeuristicLab.Security.Core-3.2.csproj	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/HeuristicLab.Security.Core-3.2.csproj	(revision 4072)
@@ -0,0 +1,144 @@
+﻿<?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>{CE2DFB48-6A9C-4507-96C6-5FC40E92035C}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Security.Core</RootNamespace>
+    <AssemblyName>HeuristicLab.Security.Core-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>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.ServiceModel">
+      <RequiredTargetFramework>3.0</RequiredTargetFramework>
+    </Reference>
+    <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="PermissionManager.cs" />
+    <Compile Include="SecurityCorePlugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SecurityCoreTest.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>
+    <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.2\HeuristicLab.DataAccess-3.2.csproj">
+      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
+      <Name>HeuristicLab.DataAccess-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Hive.Server.Core\3.2\HeuristicLab.Hive.Server.Core-3.2.csproj">
+      <Project>{898B31CF-81DC-453B-AEB3-BDF83197A7EE}</Project>
+      <Name>HeuristicLab.Hive.Server.Core-3.2</Name>
+    </ProjectReference>
+    <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>
+    <ProjectReference Include="..\..\HeuristicLab.Security.DataAccess\3.2\HeuristicLab.Security.DataAccess-3.2.csproj">
+      <Project>{AC3D84FF-F0D7-43F0-9C99-9F8DBE087E2C}</Project>
+      <Name>HeuristicLab.Security.DataAccess-3.2</Name>
+    </ProjectReference>
+  </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" />
+  <!-- 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/PermissionManager.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/PermissionManager.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/PermissionManager.cs	(revision 4072)
@@ -0,0 +1,149 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading;
+using HeuristicLab.Security.Contracts.Interfaces;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.DataAccess.Interfaces;
+using HeuristicLab.PluginInfrastructure;
+using System.Security.Cryptography;
+using System.ServiceModel;
+
+namespace HeuristicLab.Security.Core {
+  public class PermissionManager : IPermissionManager{
+
+    private static ISessionFactory factory;
+    private static ISessionFactory Factory {
+      get {
+        // lazy initialization
+        if(factory==null) 
+          factory = ServiceLocator.GetSessionFactory();
+        return factory;
+      }      
+    }
+
+    private static ISession session;
+    
+    private static IDictionary<Guid,string> currentSessions = new Dictionary<Guid, string>();
+    Object locker = new Object();
+
+    private static string getMd5Hash(string input) {
+      // Create a new instance of the MD5CryptoServiceProvider object.
+      MD5 md5Hasher = MD5.Create();
+
+      // Convert the input string to a byte array and compute the hash.
+      byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
+
+      // Create a new Stringbuilder to collect the bytes
+      // and create a string.
+      StringBuilder sBuilder = new StringBuilder();
+
+      // Loop through each byte of the hashed data 
+      // and format each one as a hexadecimal string.
+      for (int i = 0; i < data.Length; i++) {
+        sBuilder.Append(data[i].ToString("x2"));
+      }
+
+      // Return the hexadecimal string.
+      return sBuilder.ToString();
+    }
+
+   /// <summary>
+   /// If a session exists for this userName then it is returned, otherwise the given password
+   /// is checked and a new session is created.
+   /// </summary>
+   /// <param name="userName"></param>
+   /// <param name="password"></param>
+   /// <returns></returns>
+    public Guid Authenticate(String userName, String password) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        password = getMd5Hash(password);
+
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+        User user = userAdapter.GetByLogin(userName);
+
+        if (user != null &&
+            user.Password.Equals(password)) {
+          Guid sessionId;
+
+          lock (locker) {
+            if (currentSessions.Values.Contains(userName)) {
+              sessionId = GetGuid(userName);
+            } else {
+              sessionId = Guid.NewGuid();
+              currentSessions.Add(sessionId, userName);
+            }
+          }
+
+          return sessionId;
+        } else 
+          return Guid.Empty;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Checks if the owner of the given session has the given permission.
+    /// </summary>
+    /// <param name="sessionId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    public bool CheckPermission(Guid sessionId, Guid permissionId, Guid entityId) {
+      string userName;
+      bool existsSession;
+      lock (locker)
+        existsSession = currentSessions.TryGetValue(sessionId, out userName);
+      if (existsSession) {
+        try {
+          session = Factory.GetSessionForCurrentThread();
+          
+          IPermissionOwnerAdapter permOwnerAdapter = session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+          PermissionOwner permOwner = permOwnerAdapter.GetByName(userName);
+
+          IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+          Permission permission = permissionAdapter.GetById(permissionId);
+          
+          if ((permission != null) && (permOwner != null))
+            return (permissionAdapter.getPermission(permOwner.Id, permission.Id, entityId) != null);
+          else return false;
+        }
+        catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+        finally {
+          if (session != null)
+            session.EndSession();
+        }
+      } else return false;
+    }
+
+    /// <summary>
+    /// Removes the given session.
+    /// </summary>
+    /// <param name="sessionId"></param>
+    public void EndSession(Guid sessionId) {
+      lock (locker) {
+        if (currentSessions.Keys.Contains(sessionId))
+          currentSessions.Remove(sessionId);
+      }
+    }
+
+    /// <summary>
+    /// Gets the sessionId for a user.
+    /// </summary>
+    /// <param name="userName"></param>
+    /// <returns></returns>
+    public Guid GetGuid(string userName) {
+      foreach (Guid guid in currentSessions.Keys)
+        if (currentSessions[guid].CompareTo(userName) == 0)
+          return guid;
+      return Guid.Empty;
+    }
+  } 
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/AssemblyInfo.frame	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/AssemblyInfo.frame	(revision 4072)
@@ -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.Core")]
+[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("9A54C04F-E1B3-490a-AB49-D3F42CAAB4F1")]
+
+// 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.Designer.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.Designer.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.Designer.cs	(revision 4072)
@@ -0,0 +1,36 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.4927
+//
+//     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=127.0.0.1;Initial Catalog=HeuristicLab.Security;Integrated Security=T" +
+            "rue;Pooling=true;MultipleActiveResultSets=true")]
+        public string SecurityServerConnectionString {
+            get {
+                return ((string)(this["SecurityServerConnectionString"]));
+            }
+        }
+    }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.settings
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.settings	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/Properties/Settings.settings	(revision 4072)
@@ -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="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="SecurityServerConnectionString" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Security;Integrated Security=True;Pooling=true;MultipleActiveResultSets=true</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCorePlugin.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCorePlugin.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCorePlugin.cs	(revision 4072)
@@ -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.Core {
+  [Plugin("HeuristicLab.Security.Core-3.2")]
+  [PluginFile("HeuristicLab.Security.Core-3.2.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core-3.2")]
+  public class SecurityCorePlugin : PluginBase {
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCoreTest.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCoreTest.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityCoreTest.cs	(revision 4072)
@@ -0,0 +1,328 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Hive.Server.Core;
+using System.Diagnostics;
+
+namespace HeuristicLab.Security.Core {
+    [Application("Security Test App", "Test Application for the Security Service")]
+  class SecurityCoreTest : ApplicationBase {
+
+      SecurityManager manager = new SecurityManager();
+      PermissionManager permManager =  new PermissionManager();
+
+
+      private void testGroups() {
+
+        User user = new User();
+        user.Login = "anna";
+        user.SetHashedPassword("blubb");
+        user.Name = "Anna";
+        user = manager.AddNewUser(user);
+
+        User user2 = new User();
+        user2.Login = "stefan";
+        user2.Name = "Stefan";
+
+        UserGroup group = new UserGroup();
+        group.Name = "Students";
+
+        UserGroup group2 = new UserGroup();
+        group2.Name = "Lazy Students";
+
+        group.Members.Add(user);
+        group.Members.Add(group2);
+
+        group2.Members.Add(user2);
+
+        manager.AddNewUserGroup(group);
+
+        group = manager.GetUserGroupByName("Students");
+        group2 = manager.GetUserGroupByName("Lazy Students");
+
+        manager.RemoveUserGroup(group2.Id);
+
+        group = manager.GetUserGroupByName("Students");
+        group2 = manager.GetUserGroupByName("Lazy Students");
+
+        manager.RemoveUser(user.Id);
+
+        group = manager.GetUserGroupByName("Students");
+        manager.RemoveUserGroup(group.Id);
+
+        group = manager.GetUserGroupByName("Students");
+        manager.RemoveUser(user2.Id);
+      }
+
+      private void testPermissions() {
+
+        Permission permission = new Permission();
+        permission.Name = "ADD_JOBS";
+        permission.Description = "Add jobs";
+        permission.Plugin = "TestPlugin";
+
+        manager.AddPermission(permission);
+
+        permission = manager.GetPermissionById(permission.Id);
+
+        User user = new User();
+        user.Login = "anna";
+        user.SetHashedPassword("blubb");
+        user.Name = "Anna";
+        user = manager.AddNewUser(user);
+
+        manager.GrantPermission(user.Id, permission.Id, Guid.Empty);
+
+        Guid sessionId = permManager.Authenticate("anna", "blubb");
+
+        bool hasPermission = 
+          permManager.CheckPermission(sessionId, permission.Id, Guid.Empty);
+
+        manager.RevokePermission(user.Id, permission.Id, Guid.Empty);
+
+        hasPermission =
+          permManager.CheckPermission(sessionId, permission.Id, Guid.Empty);
+
+        permManager.EndSession(sessionId);
+
+        manager.RemoveUser(user.Id);
+
+        manager.RemovePermission(permission.Id);
+
+        permission = manager.GetPermissionById(permission.Id);
+      }
+
+      private void testPermissionsGroup() {
+
+        User user = new User();
+        user.Login = "anna";
+        user.SetHashedPassword("blubb");
+        user.Name = "Anna";
+        user = manager.AddNewUser(user);
+
+        User user2 = new User();
+        user2.Login = "stefan";
+        user2.SetHashedPassword("foo");
+        user2.Name = "Stefan";
+
+        UserGroup group = new UserGroup();
+        group.Name = "Students";
+
+        UserGroup group2 = new UserGroup();
+        group2.Name = "Lazy Students";
+
+        group.Members.Add(user);
+        group.Members.Add(group2);
+
+        group2.Members.Add(user2);
+
+        manager.AddNewUserGroup(group);
+
+        Permission permission = new Permission();
+        permission.Name = "ADD_JOBS";
+        permission.Description = "Add jobs";
+        permission.Plugin = "TestPlugin";
+
+        manager.AddPermission(permission);
+
+        manager.GrantPermission(group.Id, permission.Id, Guid.Empty);
+        manager.GrantPermission(group2.Id, permission.Id, Guid.Empty);
+
+        Guid sessionId = permManager.Authenticate("anna", "blubb");
+
+        bool hasPermission =
+          permManager.CheckPermission(sessionId, permission.Id, Guid.Empty);
+
+        Guid sessionId2 = permManager.Authenticate("stefan", "foo");
+
+        hasPermission =
+          permManager.CheckPermission(sessionId2, permission.Id, Guid.Empty);
+
+        manager.RevokePermission(group.Id, permission.Id, Guid.Empty);
+
+        hasPermission =
+          permManager.CheckPermission(sessionId, permission.Id, Guid.Empty);
+
+        hasPermission =
+          permManager.CheckPermission(sessionId2, permission.Id, Guid.Empty);
+
+        manager.RevokePermission(group2.Id, permission.Id, Guid.Empty);
+
+        hasPermission =
+          permManager.CheckPermission(sessionId2, permission.Id, Guid.Empty);
+
+        permManager.EndSession(sessionId);
+        permManager.EndSession(sessionId2);
+
+        manager.RemoveUser(user.Id);
+        manager.RemoveUser(user2.Id);
+        manager.RemoveUserGroup(group.Id);
+        manager.RemoveUserGroup(group2.Id);
+
+        manager.RemovePermission(permission.Id);
+      }
+ 
+
+      public void InsertClientUser() {
+        PermissionCollection pc = HivePermissions.GetPermissions();
+        Debug.WriteLine("Revoke permissions....");
+        try {
+          UserGroup group = manager.GetUserGroupByName("Projektmitglieder");
+          manager.RevokePermission(group.Id, pc[pc.Convert(HivePermissions.Usermanagement.Client.Read)].Id, Guid.Empty);
+          manager.RevokePermission(group.Id, pc[pc.Convert(HivePermissions.Usermanagement.ClientGroup.Read)].Id, Guid.Empty);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Remove user...");
+        try {
+          manager.RemoveUser(manager.GetUserByName("HIVE User").Id);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Remove group....");
+        try {
+          manager.RemoveUserGroup(manager.GetUserGroupByName("Projektmitglieder").Id);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+
+        User user = new User();
+        user.Login = "hive";
+        user.SetHashedPassword("hive");
+        user.Name = "HIVE User";
+        Debug.WriteLine("Adding user...");
+        try {
+          user = manager.AddNewUser(user);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+
+        UserGroup grp = new UserGroup();
+        grp.Name = "Projektmitglieder";
+        grp.Members.Add(user);
+        Debug.WriteLine("Adding group...");
+        try {
+          manager.AddNewUserGroup(grp);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Grant permissions...");
+        try {
+          manager.GrantPermission(grp.Id, pc[pc.Convert(HivePermissions.Usermanagement.Client.Read)].Id, Guid.Empty);
+          manager.GrantPermission(grp.Id, pc[pc.Convert(HivePermissions.Usermanagement.ClientGroup.Read)].Id, Guid.Empty);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+      }
+
+      public void InsertSuperUser() {
+        Debug.WriteLine("Revoke permissions...");
+        try {
+          UserGroup group = manager.GetUserGroupByName("Administratoren");
+          foreach (Permission item in HivePermissions.GetPermissions()) {
+            manager.RevokePermission(group.Id, item.Id, Guid.Empty);
+          }
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Revoke permissions from admin...");
+        try {
+          Guid g = manager.GetUserByName("HIVE Admin").Id;
+          foreach (Permission item in HivePermissions.GetPermissions()) {
+            manager.RevokePermission(g, item.Id, Guid.Empty);
+          }
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Removing user...");
+        try {
+          manager.RemoveUser(manager.GetUserByName("HIVE Admin").Id);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Removing group...");
+        try {
+          manager.RemoveUserGroup(manager.GetUserGroupByName("Administratoren").Id);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+
+        User user = new User();
+        user.Login = "admin";
+        user.SetHashedPassword("admin");
+        user.Name = "HIVE Admin";
+        User tmp = manager.AddNewUser(user);
+
+        Debug.WriteLine("Grant ALL permissions to admin...");
+        foreach (Permission item in HivePermissions.GetPermissions()) {
+          try {
+            manager.GrantPermission(tmp.Id, item.Id, Guid.Empty);
+          }
+          catch (Exception ex) {
+            Debug.WriteLine(ex.Message);
+          }
+        }
+        Debug.WriteLine("Adding user...");
+        try {
+          user = manager.AddNewUser(user);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+
+        UserGroup grp = new UserGroup();
+        grp.Name = "Administratoren";
+        grp.Members.Add(user);
+        Debug.WriteLine("Adding group...");
+        try {
+          manager.AddNewUserGroup(grp);
+        }
+        catch (Exception ex) {
+          Debug.WriteLine(ex.Message);
+        }
+        Debug.WriteLine("Adding permissions...");
+        //admins allowed to do everything ;)
+        foreach (Permission item in HivePermissions.GetPermissions()) {
+          try {
+            manager.GrantPermission(grp.Id, item.Id, Guid.Empty);
+          }
+          catch (Exception ex) {
+            Debug.WriteLine(ex.Message);
+          }
+        }
+      }
+
+      public void InsertHivePermissions() {
+        foreach (Permission item in HivePermissions.GetPermissions()) {
+          try {
+            manager.AddPermission(item);
+          }
+          catch (Exception ex) {
+            Debug.WriteLine(ex.Message);
+          }
+        }
+      }
+
+      public override void Run() {
+        //testPermissionsGroup();
+        
+        InsertHivePermissions();
+        InsertClientUser();
+        InsertSuperUser();
+        Debug.WriteLine("Complete!");
+      }
+    }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityManager.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityManager.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/SecurityManager.cs	(revision 4072)
@@ -0,0 +1,456 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Security.Contracts.Interfaces;
+using HeuristicLab.Security.Contracts.BusinessObjects;
+using HeuristicLab.Security.DataAccess;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.DataAccess.Interfaces;
+using System.ServiceModel;
+
+namespace HeuristicLab.Security.Core {
+  public class SecurityManager : ISecurityManager {
+
+    private static ISessionFactory factory;
+    private static ISessionFactory Factory {
+      get {
+        // lazy initialization
+        if(factory==null)
+          factory = ServiceLocator.GetSessionFactory();
+        return factory;
+      }
+    }
+
+    private ISession session;
+
+   /// <summary>
+    /// Add new user.
+    /// </summary>
+    /// <param name="user"></param>
+    /// <returns></returns>
+    public User AddNewUser(User user) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+        if (user != null)
+          userAdapter.Update(user);
+
+        return user;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      } 
+    }
+
+    /// <summary>
+    /// Update user.
+    /// </summary>
+    /// <param name="user"></param>
+    /// <returns></returns>
+    public User UpdateUser(User user) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+
+        if (user != null)
+          userAdapter.Update(user);
+        return user;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+   /// <summary>
+    /// Remove user.
+   /// </summary>
+   /// <param name="userId"></param>
+   /// <returns></returns>
+    public bool RemoveUser(Guid userId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+        User user = userAdapter.GetById(userId);
+
+        if (user != null) 
+          return userAdapter.Delete(user);
+        return false;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Gets all Users.
+    /// </summary>
+    /// <returns></returns>
+    public ICollection<User> GetAllUsers() {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+
+        return userAdapter.GetAll();
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }         
+    }
+
+    /// <summary>
+    /// Gets user by name.
+    /// </summary>
+    /// <param name="name"></param>
+    /// <returns></returns>
+    public User GetUserByName(string name) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+
+        return userAdapter.GetByName(name);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }  
+    }
+
+    /// <summary>
+    /// Gets user by his login.
+    /// </summary>
+    /// <param name="login"></param>
+    /// <returns></returns>
+    public User GetUserByLogin(string login) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserAdapter userAdapter = session.GetDataAdapter<User, IUserAdapter>();
+
+        return userAdapter.GetByLogin(login);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Add new user group.
+    /// </summary>
+    /// <param name="group"></param>
+    /// <returns></returns>
+    public UserGroup AddNewUserGroup(UserGroup userGroup) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+        if (userGroup != null)
+          userGroupAdapter.Update(userGroup);
+
+        return userGroup;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      } 
+    }
+
+    /// <summary>
+    /// Update user group.
+    /// </summary>
+    /// <param name="group"></param>
+    /// <returns></returns>
+    public UserGroup UpdateUserGroup(UserGroup userGroup) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+        if (userGroup != null)
+          userGroupAdapter.Update(userGroup);
+
+        return userGroup;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      } 
+    }
+
+    /// <summary>
+    /// Remove user group.
+    /// </summary>
+    /// <param name="groupId"></param>
+    /// <returns></returns>
+    public bool RemoveUserGroup(Guid userGroupId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+        UserGroup userGroup = userGroupAdapter.GetById(userGroupId);   
+
+        if (userGroup != null) 
+          return userGroupAdapter.Delete(userGroup);
+        return false;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      } 
+    }
+
+    /// <summary>
+    /// Gets all UserGroups.
+    /// </summary>
+    /// <returns></returns>
+    public ICollection<UserGroup> GetAllUserGroups() {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+
+        return userGroupAdapter.GetAll();
+       }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Gets UserGroup by name.
+    /// </summary>
+    /// <param name="name"></param>
+    /// <returns></returns>
+    public UserGroup GetUserGroupByName(string name) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+
+        return userGroupAdapter.GetByName(name);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Updates a PermissionOwner.
+    /// </summary>
+    /// <param name="permissionOwner"></param>
+    /// <returns></returns>
+    public PermissionOwner UpdatePermissionOwner(PermissionOwner permissionOwner) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IPermissionOwnerAdapter permOwnerAdapter = session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+        if (permissionOwner != null)
+          permOwnerAdapter.Update(permissionOwner);
+
+        return permissionOwner;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      } 
+    }
+
+    /// <summary>
+    /// Add permission owner to group.
+    /// </summary>
+    /// <param name="userGroupId"></param>
+    /// <param name="permissionOwnerId"></param>
+    /// <returns></returns>
+    public bool AddPermissionOwnerToGroup(Guid userGroupId, Guid permissionOwnerId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        ITransaction transaction = session.BeginTransaction();
+
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+        UserGroup userGroup = userGroupAdapter.GetById(userGroupId);
+
+        IPermissionOwnerAdapter permOwnerAdapter = session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+        PermissionOwner permissionOwner = permOwnerAdapter.GetById(permissionOwnerId);
+        
+        if ((userGroup != null) && (permissionOwner != null)) {
+          userGroup.Members.Add(permissionOwner);
+          userGroupAdapter.Update(userGroup);
+          transaction.Commit();
+          return true;
+        }
+        return false;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+
+    /// <summary>
+    /// Remove permission owner from group.
+    /// </summary>
+    /// <param name="groupId"></param>
+    /// <param name="permissionOwnerId"></param>
+    /// <returns></returns>
+    public bool RemovePermissionOwnerFromGroup(Guid userGroupId, Guid permissionOwnerId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        ITransaction transaction = session.BeginTransaction();
+
+        IUserGroupAdapter userGroupAdapter = session.GetDataAdapter<UserGroup, IUserGroupAdapter>();
+        UserGroup userGroup = userGroupAdapter.GetById(userGroupId);
+
+        IPermissionOwnerAdapter permOwnerAdapter = session.GetDataAdapter<PermissionOwner, IPermissionOwnerAdapter>();
+        PermissionOwner permissionOwner = permOwnerAdapter.GetById(permissionOwnerId);
+
+        if ((userGroup != null) && (permissionOwner != null)) {
+          userGroup.Members.Add(permissionOwner);
+          userGroupAdapter.Delete(userGroup);
+          transaction.Commit();
+          return true;
+        }
+        return false;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Grant permission.
+    /// </summary>
+    /// <param name="permissionOwnerId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    public bool GrantPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();                         
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+
+        return permissionAdapter.grantPermission(permissionOwnerId, permissionId, entityId);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Gets Permission by ID.
+    /// </summary>
+    /// <param name="permissionId"></param>
+    /// <returns></returns>
+    public Permission GetPermissionById(Guid permissionId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+        return permissionAdapter.GetById(permissionId);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    /// <summary>
+    /// Revoke permission.
+    /// </summary>
+    /// <param name="permissionOwnerId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    public bool RevokePermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();     
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+ 
+        return permissionAdapter.revokePermission(permissionOwnerId, permissionId, entityId);
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    public Permission AddPermission(Permission permission) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+
+        if (permission != null) {
+          permissionAdapter.Update(permission);
+
+          return permission;
+        } else
+          return null;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    public bool RemovePermission(Guid permissionId) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+
+        Permission permission = permissionAdapter.GetById(permissionId);
+        if (permission != null)
+          return permissionAdapter.Delete(permission);
+        else
+          return false;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+
+    public Permission UpdatePermission(Permission permission) {
+      try {
+        session = Factory.GetSessionForCurrentThread();
+        IPermissionAdapter permissionAdapter = session.GetDataAdapter<Permission, IPermissionAdapter>();
+
+        if(permission != null) {
+          permissionAdapter.Update(permission);
+          return permission;
+        }
+        else
+          return null;
+      }
+      catch (Exception ex) { throw new FaultException("Server: " + ex.Message); }
+      finally {
+        if (session != null)
+          session.EndSession();
+      }
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/ServiceLocator.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/ServiceLocator.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/ServiceLocator.cs	(revision 4072)
@@ -0,0 +1,34 @@
+﻿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 ISessionFactory sessionFactory = null;
+
+    /// <summary>
+    /// Gets the db session factory
+    /// </summary>
+    /// <returns></returns>
+    [MethodImpl(MethodImplOptions.Synchronized)]
+    public static ISessionFactory GetSessionFactory() {
+      if (sessionFactory == null) {
+        sessionFactory =
+          ApplicationManager.Manager.GetInstances<ISessionFactory>().First();
+
+        sessionFactory.DbConnectionType =
+          typeof(SqlConnection);
+
+        sessionFactory.DbConnectionString =
+          HeuristicLab.Security.Core.Properties.Settings.Default.SecurityServerConnectionString;      
+      }
+
+      return sessionFactory;
+    }
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/app.config
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/app.config	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Core/3.3/app.config	(revision 4072)
@@ -0,0 +1,21 @@
+﻿<?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.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+            <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.Settings>
+            <setting name="SecurityServerConnectionString" serializeAs="String">
+                <value>Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Security;Integrated Security=True;Pooling=true;MultipleActiveResultSets=true</value>
+            </setting>
+        </HeuristicLab.Security.Core.Properties.Settings>
+        <HeuristicLab.Security.Core.Properties.Settings1>
+            <setting name="SecurityServerConnectionString" serializeAs="String">
+                <value>Data Source=127.0.0.1;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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/HeuristicLab.Security.DataAccess-3.2.csproj
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/HeuristicLab.Security.DataAccess-3.2.csproj	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/HeuristicLab.Security.DataAccess-3.2.csproj	(revision 4072)
@@ -0,0 +1,111 @@
+﻿<?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>{AC3D84FF-F0D7-43F0-9C99-9F8DBE087E2C}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Security.DataAccess</RootNamespace>
+    <AssemblyName>HeuristicLab.Security.DataAccess-3.2</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <StartupObject>
+    </StartupObject>
+    <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>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <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>
+  -->
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.DataAccess\3.2\HeuristicLab.DataAccess-3.2.csproj">
+      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
+      <Name>HeuristicLab.DataAccess-3.2</Name>
+    </ProjectReference>
+    <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>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="IPermissionAdapter.cs" />
+    <Compile Include="IPermissionOwnerAdapter.cs" />
+    <Compile Include="IUserAdapter.cs" />
+    <Compile Include="IUserGroupAdapter.cs" />
+    <Compile Include="SecurityDataAccessPlugin.cs" />
+  </ItemGroup>
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+</Project>
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionAdapter.cs	(revision 4072)
@@ -0,0 +1,60 @@
+﻿#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.Security.Contracts.BusinessObjects;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.DataAccess {
+  /// <summary>
+  /// The permission database adapter
+  /// </summary>
+  public interface IPermissionAdapter: IDataAdapter<Permission> {
+    /// <summary>
+    /// Determines, if the permission Owner has the permission on the entity
+    /// </summary>
+    /// <param name="permissionOwnerId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    GrantedPermission getPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId);
+
+    /// <summary>
+    /// Adds a permission
+    /// </summary>
+    /// <param name="permissionOwnerId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    bool grantPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId);
+
+    /// <summary>
+    /// Removes a permission
+    /// </summary>
+    /// <param name="permissionOwnerId"></param>
+    /// <param name="permissionId"></param>
+    /// <param name="entityId"></param>
+    /// <returns></returns>
+    bool revokePermission(Guid permissionOwnerId, Guid permissionId, Guid entityId);
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionOwnerAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionOwnerAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IPermissionOwnerAdapter.cs	(revision 4072)
@@ -0,0 +1,47 @@
+﻿#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.Security.Contracts.BusinessObjects;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.DataAccess {
+  /// <summary>
+  /// The permission owner database adapter
+  /// </summary>
+  public interface IPermissionOwnerAdapter: IPolymorphicDataAdapter<PermissionOwner> {
+    /// <summary>
+    /// Gets the permissionOwner and updates the values of the object
+    /// </summary>
+    /// <param name="resource"></param>
+    /// <returns></returns>
+    bool GetById(PermissionOwner permOwner);
+    
+    /// <summary>
+    /// Get the permission owner with the specified name
+    /// </summary>
+    /// <param name="clientId"></param>
+    /// <returns></returns>
+    PermissionOwner GetByName(String name);
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserAdapter.cs	(revision 4072)
@@ -0,0 +1,47 @@
+﻿#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.Security.Contracts.BusinessObjects;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.DataAccess {
+  /// <summary>
+  /// The user database adapter
+  /// </summary>
+  public interface IUserAdapter: IDataAdapter<User> {
+    /// <summary>
+    /// Get the user with the specified name
+    /// </summary>
+    /// <param name="userId"></param>
+    /// <returns></returns>
+    User GetByName(string name);
+
+    /// <summary>
+    /// Get the user with the specified name
+    /// </summary>
+    /// <param name="userId"></param>
+    /// <returns></returns>
+    User GetByLogin(string login);
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserGroupAdapter.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserGroupAdapter.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/IUserGroupAdapter.cs	(revision 4072)
@@ -0,0 +1,47 @@
+﻿#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.Security.Contracts.BusinessObjects;
+using HeuristicLab.DataAccess.Interfaces;
+
+namespace HeuristicLab.Security.DataAccess {
+  /// <summary>
+  /// The user group database adapter
+  /// </summary>
+  public interface IUserGroupAdapter: IDataAdapter<UserGroup> {
+    /// <summary>
+    /// Get the user group with the specified name
+    /// </summary>
+    /// <param name="clientId"></param>
+    /// <returns></returns>
+    UserGroup GetByName(String name);
+
+    /// <summary>
+    /// Gets all user groups where the permission owner is member of
+    /// </summary>
+    /// <param name="permOwner"></param>
+    /// <returns></returns>
+    ICollection<UserGroup> MemberOf(Guid permissionOwnerId);
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/Properties/AssemblyInfo.frame	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/Properties/AssemblyInfo.frame	(revision 4072)
@@ -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.DataAccess")]
+[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("CDC4BC9E-BEDD-47f1-9690-749A4DED8E46")]
+
+// 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/SecurityDataAccessPlugin.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/SecurityDataAccessPlugin.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.DataAccess/3.3/SecurityDataAccessPlugin.cs	(revision 4072)
@@ -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.DataAccess {
+  [Plugin("HeuristicLab.Security.DataAccess-3.2")]
+  [PluginFile("HeuristicLab.Security.DataAccess-3.2.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core-3.2")]
+  public class SecurityDataAccessPlugin : PluginBase {
+  }
+}
Index: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/HeuristicLab.Security.Server-3.2.csproj
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/HeuristicLab.Security.Server-3.2.csproj	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/HeuristicLab.Security.Server-3.2.csproj	(revision 4072)
@@ -0,0 +1,136 @@
+﻿<?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>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </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.Hive.Contracts\3.2\HeuristicLab.Hive.Contracts-3.2.csproj">
+      <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project>
+      <Name>HeuristicLab.Hive.Contracts-3.2</Name>
+    </ProjectReference>
+    <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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/Properties/AssemblyInfo.frame	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/Properties/AssemblyInfo.frame	(revision 4072)
@@ -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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.Designer.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.Designer.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.Designer.cs	(revision 4072)
@@ -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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.cs	(revision 4072)
@@ -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, String> baseAddrDict) {
+      InitializeComponent();
+      String 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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.resx
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.resx	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServer.resx	(revision 4072)
@@ -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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerApplication.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerApplication.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerApplication.cs	(revision 4072)
@@ -0,0 +1,127 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.PluginInfrastructure;
+using System.Text;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using System.Net;
+using System.Linq;
+using HeuristicLab.Security.Contracts.Interfaces;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Security.Server {
+
+  [Application("Security Server", "Server application for the security.", 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 Dictionary<string, ServiceHost> runningServices = new Dictionary<string, ServiceHost>();
+    private NetTcpBinding binding = (NetTcpBinding)HeuristicLab.Hive.Contracts.WcfSettings.GetBinding();
+
+    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 String StartService(Services svc, IPAddress ipAddress, int port) {
+      string curServiceHost = "";
+      Uri uriTcp;
+      String result = "";
+      IEnumerable<ISecurityManager> securityManagerInstances = ApplicationManager.Manager.GetInstances<ISecurityManager>();
+      IEnumerable<IPermissionManager> permissionManagerInstances = ApplicationManager.Manager.GetInstances<IPermissionManager>();
+      ServiceHost serviceHost = null;
+      switch (svc) {
+        case Services.PermissionManager:
+          if (permissionManagerInstances.Count() > 0) {
+            uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityServer/");
+            serviceHost = new ServiceHost(permissionManagerInstances.First().GetType(), uriTcp);
+            serviceHost.AddServiceEndpoint(typeof(IPermissionManager), binding, STR_PermissionManager);
+            curServiceHost = STR_PermissionManager;
+            result = uriTcp.ToString() + STR_PermissionManager;
+          }
+          break;
+        case Services.SecurityManager:
+          if (securityManagerInstances.Count() > 0) {
+            uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityServer/");
+            serviceHost = new ServiceHost(securityManagerInstances.First().GetType(), uriTcp);
+            serviceHost.AddServiceEndpoint(typeof(ISecurityManager), binding, STR_SecurityManager);
+            curServiceHost = STR_SecurityManager;
+            result = uriTcp.ToString() + 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 result;
+      } 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, String> baseAddrDict = new Dictionary<string, String>();
+      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: /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerPlugin.cs
===================================================================
--- /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerPlugin.cs	(revision 4072)
+++ /branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Security.Server/3.3/SecurityServerPlugin.cs	(revision 4072)
@@ -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 {
+  [Plugin("HeuristicLab.Security.Server-3.2")]
+  [PluginFile("HeuristicLab.Security.Server-3.2.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core-3.2")]
+  public class SecurityServerPlugin : PluginBase {
+  }
+}
