Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs @ 902

Last change on this file since 902 was 902, checked in by msteinbi, 16 years ago

Implementation of UserRoleManager (#417)

File size: 2.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Hive.Contracts.Interfaces;
6using HeuristicLab.Hive.Contracts.BusinessObjects;
7using HeuristicLab.Hive.Server.Core.InternalInterfaces.DataAccess;
8using System.Resources;
9using System.Reflection;
10using HeuristicLab.Hive.Contracts;
11
12namespace HeuristicLab.Hive.Server.Core {
13  class UserRoleManager: IUserRoleManager {
14
15    List<User> users;
16    List<UserGroup> userGroups;
17
18    IUserAdapter userAdapter;
19    ResourceManager rm;
20
21    public UserRoleManager() {
22      userAdapter = ServiceLocator.GetUserAdapter();
23      rm = new ResourceManager("HiveServerMessages.resx", Assembly.GetExecutingAssembly());
24
25      users = new List<User>();
26      userGroups = new List<UserGroup>();
27
28      users.Add(new User { PermissionOwnerId = 1, Name = "Hugo", Password = "hUg0" });
29      users.Add(new User { PermissionOwnerId = 2, Name = "Seppl", Password = "seppl" });
30      users.Add(new User { PermissionOwnerId = 3, Name = "Greg", Password = "greg" });
31
32      userGroups.Add(new UserGroup { UserGroupId = 1 });
33      userGroups.Add(new UserGroup { UserGroupId = 2 });
34    }
35
36    #region IUserRoleManager Members
37
38    public ResponseList<User> GetAllUsers() {
39      return null;     
40    }
41
42    public Response AddNewUser(User user) {
43      User dbUser = userAdapter.GetUserByName(user.Name);
44
45      return null;
46    }
47
48    public ResponseList<UserGroup> GetAllUserGroups() {
49      return null;
50    }
51
52    public Response RemoveUser(long userId) {
53      return null;
54    }
55
56    public Response AddNewUserGroup(UserGroup userGroup) {
57      return null;
58    }
59
60    public Response RemoveUserGroup(long groupId) {
61      return null;
62    }
63
64    public Response AddUserToGroup(long groupId, long userId) {
65      throw new NotImplementedException();
66    }
67
68    public Response RemoveUserFromGroup(long groupId, long userId) {
69      throw new NotImplementedException();
70    }
71
72    #endregion
73  }
74}
Note: See TracBrowser for help on using the repository browser.