Index: trunk/sources/HeuristicLab.Security.Core/HeuristicLab.Security.Core.csproj
===================================================================
--- trunk/sources/HeuristicLab.Security.Core/HeuristicLab.Security.Core.csproj	(revision 1409)
+++ trunk/sources/HeuristicLab.Security.Core/HeuristicLab.Security.Core.csproj	(revision 1409)
@@ -0,0 +1,73 @@
+﻿<?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</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.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="SecurityManager.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Security.Contracts\HeuristicLab.Security.Contracts.csproj">
+      <Project>{D59E852C-F205-4647-8C05-EB9ED1CF44E9}</Project>
+      <Name>HeuristicLab.Security.Contracts</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Security.DataAccess\HeuristicLab.Security.DataAccess.csproj">
+      <Project>{AC3D84FF-F0D7-43F0-9C99-9F8DBE087E2C}</Project>
+      <Name>HeuristicLab.Security.DataAccess</Name>
+    </ProjectReference>
+  </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>
+  -->
+</Project>
Index: trunk/sources/HeuristicLab.Security.Core/SecurityCorePlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.Security.Core/SecurityCorePlugin.cs	(revision 1409)
+++ trunk/sources/HeuristicLab.Security.Core/SecurityCorePlugin.cs	(revision 1409)
@@ -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 {
+  [ClassInfo(Name = "HeuristicLab.Security.Core-3.2")]
+  [PluginFile(Filename = "HeuristicLab.Security.Core-3.2.dll", Filetype = PluginFileType.Assembly)]
+  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
+  public class SecurityCorePlugin : PluginBase {
+  }
+}
Index: trunk/sources/HeuristicLab.Security.Core/SecurityManager.cs
===================================================================
--- trunk/sources/HeuristicLab.Security.Core/SecurityManager.cs	(revision 1409)
+++ trunk/sources/HeuristicLab.Security.Core/SecurityManager.cs	(revision 1409)
@@ -0,0 +1,80 @@
+﻿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;
+
+namespace HeuristicLab.Security.Core {
+  public class SecurityManager : ISecurityManager {
+
+    private static DiscoveryService discoveryService =
+      new DiscoveryService();
+
+    private static IUserAdapter userAdapter = discoveryService.GetInstances<IUserAdapter>()[0];
+    private static IUserGroupAdapter userGroupAdapter = discoveryService.GetInstances<IUserGroupAdapter>()[0];
+    private static IPermissionOwnerAdapter permOwnerAdapter = discoveryService.GetInstances<IPermissionOwnerAdapter>()[0];
+    private static IPermissionAdapter permissionAdapter = discoveryService.GetInstances<IPermissionAdapter>()[0];
+
+    public User AddNewUser(User user) {
+      userAdapter.Update(user);
+      return user;
+    }
+
+    public User UpdateUser(User user) {
+      userAdapter.Update(user);
+      return user;
+    }
+
+    public bool RemoveUser(Guid userId) {
+      User user = userAdapter.GetById(userId);
+      if ( user != null )       // do we check this ?
+        return userAdapter.Delete(user);
+      return false;
+    }
+
+    public UserGroup AddNewUserGroup(UserGroup group) {
+      userGroupAdapter.Update(group);
+      return group;
+    }
+
+    public UserGroup UpdateUserGroup(UserGroup group) {
+      userGroupAdapter.Update(group);
+      return group;
+    }
+
+    public bool RemoveUserGroup(Guid groupId) {
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
+      if (userGroup != null)
+        return userGroupAdapter.Delete(userGroup);
+      return false;
+    }
+
+    public bool AddPermissionOwnerToGroup(Guid groupId, Guid permissionOwnerId) {
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
+      PermissionOwner permissionOwner = permOwnerAdapter.GetById(permissionOwnerId); 
+      userGroup.Members.Add(permissionOwner);
+      userGroupAdapter.Update(userGroup);
+      return true;
+    }
+
+    public bool RemovePermissionOwnerFromGroup(Guid groupId, Guid permissionOwnerId) {
+      UserGroup userGroup = userGroupAdapter.GetById(groupId);
+      PermissionOwner permissionOwner = permOwnerAdapter.GetById(permissionOwnerId);
+      userGroup.Members.Add(permissionOwner);
+      userGroupAdapter.Delete(userGroup);
+      return true;
+    }
+
+    public bool GrantPermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      return permissionAdapter.addPermission(permissionOwnerId, permissionId, entityId);
+    }
+
+    public bool RevokePermission(Guid permissionOwnerId, Guid permissionId, Guid entityId) {
+      return permissionAdapter.removePermission(permissionOwnerId, permissionId, entityId);
+    }
+ 
+  }
+}
