Free cookie consent management tool by TermsFeed Policy Generator

Changeset 937 for trunk


Ignore:
Timestamp:
12/10/08 13:47:17 (15 years ago)
Author:
msteinbi
Message:

Implementation of UserRoleManager (#417)

Location:
trunk/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/ApplicationConstants.cs

    r934 r937  
    1919    public static string RESPONSE_USERROLE_PERMISSIONOWNER_ADDED = "UserRole.PermissionOwnerAdded";
    2020    public static string RESPONSE_USERROLE_GET_ALL_USERGROUPS = "UserRole.AllUserGroupsReturned";
     21    public static string RESPONSE_USERROLE_ID_MUST_NOT_BE_SET = "UserRole.IdMustNotBeSet";
    2122
    2223    public static string RESPONSE_CLIENT_GET_ALL_CLIENTS = "Client.GetAllClients";
  • trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/ClientGroup.cs

    r934 r937  
    3131  public class ClientGroup : Resource {
    3232    [DataMember]
    33     public long ClientGroupId { get; set; }
    34     [DataMember]
    3533    public List<Resource> Resources { get; set; }
    3634
  • trunk/sources/HeuristicLab.Hive.Contracts/HiveServerMessages.resx

    r934 r937  
    178178    <value>User successfully added to database</value>
    179179  </data>
     180  <data name="UserRole.IdMustNotBeSet" xml:space="preserve">
     181    <value>In this context the id must not be set</value>
     182  </data>
    180183</root>
  • trunk/sources/HeuristicLab.Hive.Server.Core/ClientManager.cs

    r934 r937  
    4343      clientGroups = new List<ClientGroup>();
    4444
    45       ClientGroup cg = new ClientGroup { ResourceId = 4, Name = "SuperGroup", ClientGroupId = 1 };
     45      ClientGroup cg = new ClientGroup { ResourceId = 4, Name = "SuperGroup" };
    4646      cg.Resources = new List<Resource>();
    4747
     
    7878
    7979    public Response AddClientGroup(ClientGroup clientGroup) {
    80       throw new NotImplementedException();
     80      Response response = new Response();
     81
     82      ClientGroup clientGroupFromDb = clientGroupAdapter.GetClientGroupById(clientGroup.ResourceId);
     83     
     84
     85      return response;
    8186    }
    8287
  • trunk/sources/HeuristicLab.Hive.Server.Core/UserRoleManager.cs

    r934 r937  
    3737      Response response = new Response();
    3838
    39       User dbUser = userAdapter.GetUserByName(user.Name);
    40       if (dbUser != null) {
     39      if (user.PermissionOwnerId != null) {
    4140        response.Success = false;
    42         response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USER_EXISTS_ALLREADY;
     41        response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ID_MUST_NOT_BE_SET;
    4342        return response;
    4443      }
     
    7776    public Response AddNewUserGroup(UserGroup userGroup) {
    7877      Response response = new Response();
    79 
    80       UserGroup userGroupFromDb = userGroupAdapter.GetUserGroupById(userGroup.PermissionOwnerId);
    81       if (userGroupFromDb != null) {
     78     
     79      if (userGroup.PermissionOwnerId != null) {
    8280        response.Success = false;
    83         response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_USERGROUP_EXISTS_ALLREADY;
     81        response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ID_MUST_NOT_BE_SET;
    8482        return response;
    8583      }
     
    109107    public Response AddPermissionOwnerToGroup(long groupId, PermissionOwner permissionOwner) {
    110108      Response response = new Response();
    111      
     109
     110      if (permissionOwner.PermissionOwnerId != null) {
     111        response.Success = false;
     112        response.StatusMessage = ApplicationConstants.RESPONSE_USERROLE_ID_MUST_NOT_BE_SET;
     113        return response;
     114      }
     115
    112116      UserGroup userGroup = userGroupAdapter.GetUserGroupById(groupId);
    113117      if (userGroup == null) {
Note: See TracChangeset for help on using the changeset viewer.