Index: /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration/AdministrationService.cs
===================================================================
--- /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration/AdministrationService.cs	(revision 7359)
+++ /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/Administration/AdministrationService.cs	(revision 7360)
@@ -24,4 +24,5 @@
 using System.Linq;
 using System.ServiceModel;
+using HeuristicLab.Services.Access;
 using HeuristicLab.Services.OKB.DataAccess;
 
@@ -32,6 +33,10 @@
   [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
   public class AdministrationService : IAdministrationService {
+    IRoleVerifier roleVerifier = AccessServiceLocator.Instance.RoleVerifier;
+
     #region Platform Methods
     public DataTransfer.Platform GetPlatform(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return Convert.ToDto(okb.Platforms.FirstOrDefault(x => x.Id == id));
@@ -39,4 +44,6 @@
     }
     public IEnumerable<DataTransfer.Platform> GetPlatforms() {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.Platforms.Select(x => Convert.ToDto(x)).ToArray();
@@ -44,4 +51,6 @@
     }
     public long AddPlatform(DataTransfer.Platform dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Platform entity = Convert.ToEntity(dto); entity.Id = 0;
@@ -52,4 +61,6 @@
     }
     public void UpdatePlatform(DataTransfer.Platform dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Platform entity = okb.Platforms.FirstOrDefault(x => x.Id == dto.Id);
@@ -59,4 +70,6 @@
     }
     public void DeletePlatform(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Platform entity = okb.Platforms.FirstOrDefault(x => x.Id == id);
@@ -69,4 +82,6 @@
     #region AlgorithmClass Methods
     public DataTransfer.AlgorithmClass GetAlgorithmClass(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return Convert.ToDto(okb.AlgorithmClasses.FirstOrDefault(x => x.Id == id));
@@ -74,4 +89,6 @@
     }
     public IEnumerable<DataTransfer.AlgorithmClass> GetAlgorithmClasses() {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.AlgorithmClasses.Select(x => Convert.ToDto(x)).ToArray();
@@ -79,4 +96,6 @@
     }
     public long AddAlgorithmClass(DataTransfer.AlgorithmClass dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.AlgorithmClass entity = Convert.ToEntity(dto); entity.Id = 0;
@@ -87,4 +106,6 @@
     }
     public void UpdateAlgorithmClass(DataTransfer.AlgorithmClass dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.AlgorithmClass entity = okb.AlgorithmClasses.FirstOrDefault(x => x.Id == dto.Id);
@@ -94,4 +115,6 @@
     }
     public void DeleteAlgorithmClass(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.AlgorithmClass entity = okb.AlgorithmClasses.FirstOrDefault(x => x.Id == id);
@@ -104,4 +127,6 @@
     #region Algorithm Methods
     public DataTransfer.Algorithm GetAlgorithm(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return Convert.ToDto(okb.Algorithms.FirstOrDefault(x => x.Id == id));
@@ -109,4 +134,6 @@
     }
     public IEnumerable<DataTransfer.Algorithm> GetAlgorithms() {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.Algorithms.Select(x => Convert.ToDto(x)).ToArray();
@@ -114,4 +141,6 @@
     }
     public long AddAlgorithm(DataTransfer.Algorithm dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Algorithm entity = Convert.ToEntity(dto, okb); entity.Id = 0;
@@ -122,4 +151,6 @@
     }
     public void UpdateAlgorithm(DataTransfer.Algorithm dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Algorithm entity = okb.Algorithms.FirstOrDefault(x => x.Id == dto.Id);
@@ -129,4 +160,6 @@
     }
     public void DeleteAlgorithm(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Algorithm entity = okb.Algorithms.FirstOrDefault(x => x.Id == id);
@@ -136,4 +169,6 @@
     }
     public IEnumerable<Guid> GetAlgorithmUsers(long algorithmId) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.AlgorithmUsers.Where(x => x.AlgorithmId == algorithmId).Select(x => x.UserId).ToArray();
@@ -141,4 +176,6 @@
     }
     public void UpdateAlgorithmUsers(long algorithmId, IEnumerable<Guid> users) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         okb.AlgorithmUsers.DeleteAllOnSubmit(okb.AlgorithmUsers.Where(x => x.AlgorithmId == algorithmId));
@@ -148,4 +185,6 @@
     }
     public byte[] GetAlgorithmData(long algorithmId) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         var data = okb.Algorithms.Where(x => x.Id == algorithmId).Select(x => x.BinaryData).FirstOrDefault();
@@ -155,4 +194,6 @@
     }
     public void UpdateAlgorithmData(long algorithmId, byte[] data) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         var entity = okb.Algorithms.Where(x => x.Id == algorithmId).FirstOrDefault();
@@ -166,4 +207,6 @@
     #region ProblemClass Methods
     public DataTransfer.ProblemClass GetProblemClass(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return Convert.ToDto(okb.ProblemClasses.FirstOrDefault(x => x.Id == id));
@@ -171,4 +214,6 @@
     }
     public IEnumerable<DataTransfer.ProblemClass> GetProblemClasses() {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.ProblemClasses.Select(x => Convert.ToDto(x)).ToArray();
@@ -176,4 +221,6 @@
     }
     public long AddProblemClass(DataTransfer.ProblemClass dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.ProblemClass entity = Convert.ToEntity(dto); entity.Id = 0;
@@ -184,4 +231,6 @@
     }
     public void UpdateProblemClass(DataTransfer.ProblemClass dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.ProblemClass entity = okb.ProblemClasses.FirstOrDefault(x => x.Id == dto.Id);
@@ -191,4 +240,6 @@
     }
     public void DeleteProblemClass(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.ProblemClass entity = okb.ProblemClasses.FirstOrDefault(x => x.Id == id);
@@ -201,4 +252,6 @@
     #region Problem Methods
     public DataTransfer.Problem GetProblem(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return Convert.ToDto(okb.Problems.FirstOrDefault(x => x.Id == id));
@@ -206,4 +259,6 @@
     }
     public IEnumerable<DataTransfer.Problem> GetProblems() {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.Problems.Select(x => Convert.ToDto(x)).ToArray();
@@ -211,4 +266,6 @@
     }
     public long AddProblem(DataTransfer.Problem dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Problem entity = Convert.ToEntity(dto, okb); entity.Id = 0;
@@ -219,4 +276,6 @@
     }
     public void UpdateProblem(DataTransfer.Problem dto) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Problem entity = okb.Problems.FirstOrDefault(x => x.Id == dto.Id);
@@ -226,4 +285,6 @@
     }
     public void DeleteProblem(long id) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Problem entity = okb.Problems.FirstOrDefault(x => x.Id == id);
@@ -233,4 +294,6 @@
     }
     public IEnumerable<Guid> GetProblemUsers(long problemId) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.ProblemUsers.Where(x => x.ProblemId == problemId).Select(x => x.UserId).ToArray();
@@ -238,4 +301,6 @@
     }
     public void UpdateProblemUsers(long problemId, IEnumerable<Guid> users) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         okb.ProblemUsers.DeleteAllOnSubmit(okb.ProblemUsers.Where(x => x.ProblemId == problemId));
@@ -245,4 +310,6 @@
     }
     public byte[] GetProblemData(long problemId) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         var data = okb.Problems.Where(x => x.Id == problemId).Select(x => x.BinaryData).FirstOrDefault();
@@ -252,4 +319,6 @@
     }
     public void UpdateProblemData(long problemId, byte[] data) {
+      roleVerifier.AuthenticateForAllRoles(OKBRoles.OKBAdministrator);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         var entity = okb.Problems.Where(x => x.Id == problemId).FirstOrDefault();
Index: /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj
===================================================================
--- /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj	(revision 7359)
+++ /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/HeuristicLab.Services.OKB-3.3.csproj	(revision 7360)
@@ -106,4 +106,13 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="HeuristicLab.GeoIP">
+      <HintPath>..\..\..\ClientUserManagement\ServerBinaries\HeuristicLab.GeoIP.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Services.Access">
+      <HintPath>..\..\..\ClientUserManagement\ServerBinaries\HeuristicLab.Services.Access.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Services.Access.DataAccess">
+      <HintPath>..\..\..\ClientUserManagement\ServerBinaries\HeuristicLab.Services.Access.DataAccess.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System" />
Index: /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs
===================================================================
--- /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs	(revision 7359)
+++ /branches/OKB (trunk integration)/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs	(revision 7360)
@@ -24,4 +24,5 @@
 using System.Linq;
 using System.ServiceModel;
+using HeuristicLab.Services.Access;
 using HeuristicLab.Services.OKB.DataAccess;
 
@@ -32,5 +33,9 @@
   [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
   public class RunCreationService : IRunCreationService {
+    IRoleVerifier roleVerifier = AccessServiceLocator.Instance.RoleVerifier;
+
     public IEnumerable<DataTransfer.Algorithm> GetAlgorithms(string platformName) {
+      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataLoadOptions dlo = new DataLoadOptions();
@@ -43,4 +48,6 @@
 
     public byte[] GetAlgorithmData(long algorithmId) {
+      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.Algorithms.Where(x => x.Id == algorithmId).Select(x => x.BinaryData.Data.ToArray()).FirstOrDefault();
@@ -49,4 +56,6 @@
 
     public IEnumerable<DataTransfer.Problem> GetProblems(string platformName) {
+      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataLoadOptions dlo = new DataLoadOptions();
@@ -59,4 +68,6 @@
 
     public byte[] GetProblemData(long problemId) {
+      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         return okb.Problems.Where(x => x.Id == problemId).Select(x => x.BinaryData.Data.ToArray()).FirstOrDefault();
@@ -65,4 +76,6 @@
 
     public void AddRun(DataTransfer.Run run) {
+      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
+
       using (OKBDataContext okb = new OKBDataContext()) {
         DataAccess.Run entity = Convert.ToEntity(run, okb);
