Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/11 16:51:03 (14 years ago)
Author:
cneumuel
Message:

#1233

  • created user interface for experiment sharing
  • created UserManager which provides access to the users
  • inserted a lot of security and authorization checks serverside
  • minor fixes in experiment manager
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs

    r6457 r6463  
    2424namespace HeuristicLab.Services.Hive.Tests.Mocks {
    2525  public class MockAuthorizationManager : IAuthorizationManager {
    26     public static Guid MockUserId1 = new Guid("6C7911A1-46EA-4E51-97DF-5582653AAFCE");
    27     public static Guid MockUserId2 = new Guid("897660EB-C90F-4054-988C-D39D530A0A02");
    28     public static Guid MockUserId3 = new Guid("9F7B4EA8-A38D-4BC2-802F-E148AC7A6A87");
    29 
    30     private Guid userId = MockUserId1;
    31 
    32     public Guid UserId {
    33       get { return userId; }
     26    public void Authorize(Guid userId) {
     27      // ok.
    3428    }
    3529
    36     public void AuthorizeJobs(params Guid[] jobId) {
    37       // o.k.
     30    public void AuthorizeForJob(Guid jobId, Common.DataTransfer.Permission requiredPermission) {
     31      // ok.
    3832    }
    3933
    40     public void Authorize(Guid userId) {
    41       // o.k.
    42     }
    43    
    44     internal void SetUserId(Guid id) {
    45       this.userId = id;
     34    public void AuthorizeForExperiment(Guid experimentId, Common.DataTransfer.Permission requiredPermission) {
     35      // ok.
    4636    }
    4737  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs

    r6457 r6463  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Services.Hive.DataAccess;
    2324using HeuristicLab.Services.Hive.Tests.Mocks;
    24 using System;
    2525
    2626namespace HeuristicLab.Services.Hive.Tests {
     
    3636    }
    3737
    38     private MockAuthorizationManager mockAuthorizationManager = new MockAuthorizationManager();
     38    //private MockAuthorizationManager mockAuthorizationManager = new MockAuthorizationManager();
    3939    public IAuthorizationManager AuthorizationManager {
    40       get { return mockAuthorizationManager; }
     40      get { return defaultServiceLocator.AuthorizationManager; }
    4141    }
    4242
     
    5151      get { return defaultServiceLocator.TransactionManager; }
    5252    }
    53 
     53    private MockUserManager mockUserManager = new MockUserManager();
     54    public IUserManager UserManager {
     55      get { return mockUserManager; }
     56    }
    5457    public HeartbeatManager HeartbeatManager {
    5558      get { return defaultServiceLocator.HeartbeatManager; }
     
    5760
    5861    #region Special mocking methods
    59     public void SetCurrentUser(Guid id) {
    60       mockAuthorizationManager.SetUserId(id);
     62    public void SetCurrentUserId(Guid userId) {
     63      mockUserManager.SetUserId(userId);
    6164    }
    62 
    6365    #endregion
    6466  }
Note: See TracChangeset for help on using the changeset viewer.