- Timestamp:
- 06/28/10 10:34:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs
r3964 r3967 101 101 102 102 public override string[] GetUsersInRole(string roleName) { 103 throw new NotImplementedException(); 103 List<string> userList = new List<string>(); 104 DataClassesDataContext context = DatabaseUtil.createDataClassesDataContext(); 105 if (roleName != null && context.HeuristicLabRole.Count(r => r.RoleName == roleName) > 0) { 106 107 Persistence.HeuristicLabRole role = context.HeuristicLabRole.Single(r => r.RoleName == roleName); 108 foreach (Persistence.HeuristicLabUserRole roleUser in role.HeuristicLabUserRoles) { 109 if(!userList.Contains(roleUser.HeuristicLabUser.UserName)) 110 userList.Add(roleUser.HeuristicLabUser.UserName); 111 } 112 } 113 context.Dispose(); 114 return userList.ToArray(); 104 115 } 105 116 … … 121 132 122 133 Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext(); 123 bool returnValue = ( DatabaseUtil.createDataClassesDataContext().HeuristicLabRole.Count(r => r.RoleName == roleName) == 1);134 bool returnValue = (db.HeuristicLabRole.Count(r => r.RoleName == roleName) == 1); 124 135 db.Dispose(); 125 136 return returnValue;
Note: See TracChangeset
for help on using the changeset viewer.