Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/10 23:34:51 (15 years ago)
Author:
bfarka
Message:

implemented one more function and a unittest for it (#1046)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs

    r3952 r3953  
    2222
    2323    public override void CreateRole(string roleName) {
    24       throw new NotImplementedException();
     24      CreateRole(roleName, false);
     25
     26    }
     27
     28    public virtual void CreateRole(String roleName, bool isPermission) {
     29      Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext();
     30      HeuristicLabRole role = new HeuristicLabRole();
     31      role.RoleName = roleName;
     32      role.IsPermission = isPermission;
     33      db.HeuristicLabRole.InsertOnSubmit(role);
     34      db.SubmitChanges();
    2535    }
    2636
     
    3040
    3141    public override string[] FindUsersInRole(string roleName, string usernameToMatch) {
    32       throw new NotImplementedException();
     42      throw new NotImplementedException("not implemented");
    3343    }
    3444
     
    7585      Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext();
    7686      bool returnValue = (DatabaseUtil.createDataClassesDataContext().HeuristicLabRole.Count(r => r.RoleName == roleName) == 1);
    77       db.Connection.Close();
     87      db.Dispose();
    7888      return returnValue;
    7989
Note: See TracChangeset for help on using the changeset viewer.