Changeset 945
- Timestamp:
- 12/10/08 14:52:04 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs
r942 r945 29 29 public static string RESPONSE_CLIENT_RESOURCE_REMOVED = "Client.ResourceRemoved"; 30 30 public static string RESPONSE_CLIENT_RESOURCE_NOT_FOUND = "Client.ResourceNotFound"; 31 public static string RESPONSE_CLIENT_PERMISSIONOWNER_DOESNT_EXIST = "Client.PermissionOwnerDoesntExist"; 31 32 32 33 public static string RESPONSE_COMMUNICATOR_HARDBEAT_RECEIVED = "Communicator.HeardbeatReceived"; -
trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IUserRoleManager.cs
r934 r945 25 25 ResponseList<UserGroup> GetAllUserGroups(); 26 26 [OperationContract] 27 Response AddPermissionOwnerToGroup(long groupId, PermissionOwner permissionOwner); 27 Response AddUserToGroup(long groupId, long userId); 28 [OperationContract] 29 Response AddUserGroupToGroup(long groupId, long groupToAddId); 28 30 [OperationContract] 29 31 Response RemovePermissionOwnerFromGroup(long groupId, long userId); -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r934 r945 96 96 } 97 97 98 public Response AddPermissionOwnerToGroup(long groupId, PermissionOwner permissionOwner) { 99 return userRoleManager.AddPermissionOwnerToGroup(groupId, permissionOwner); 98 public Response AddUserToGroup(long groupId, long userId) { 99 return userRoleManager.AddUserToGroup(groupId, userId); 100 } 101 102 public Response AddUserGroupToGroup(long groupId, long groupToAddId) { 103 return userRoleManager.AddUserGroupToGroup(groupId, groupToAddId); 100 104 } 101 105 -
trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs
r942 r945 15 15 IUserAdapter userAdapter; 16 16 IUserGroupAdapter userGroupAdapter; 17 IPermissionOwnerAdapter permissionOwnerAdapter; 17 18 18 19 public UserRoleManager() { … … 105 106 } 106 107 107 public Response Add PermissionOwnerToGroup(long groupId, PermissionOwner permissionOwner) {108 public Response AddUserToGroup(long groupId, long userId) { 108 109 Response response = new Response(); 109 110 110 if (permissionOwner.PermissionOwnerId != 0) { 111 User user = userAdapter.GetUserById(userId); 112 if (user == null) { 111 113 response.Success = false; 112 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ ID_MUST_NOT_BE_SET;114 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_DOESNT_EXIST; 113 115 return response; 114 116 } … … 120 122 return response; 121 123 } 122 userGroup.Members.Add( permissionOwner);124 userGroup.Members.Add(user); 123 125 userGroupAdapter.UpdateUserGroup(userGroup); 124 126 125 127 response.Success = true; 126 128 response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_PERMISSIONOWNER_ADDED; 129 130 return response; 131 } 132 133 public Response AddUserGroupToGroup(long groupId, long groupToAddId) { 134 Response response = new Response(); 127 135 128 136 return response;
Note: See TracChangeset
for help on using the changeset viewer.