- Timestamp:
- 12/10/08 14:10:52 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserGroupAdapter.cs
r936 r939 28 28 using HeuristicLab.Hive.Contracts.BusinessObjects; 29 29 using System.Runtime.CompilerServices; 30 using System.Data; 30 31 31 32 namespace HeuristicLab.Hive.Server.ADODataAccess { … … 169 170 foreach (dsHiveServer.PermissionOwner_UserGroupRow permOwnerUserGroupRow in 170 171 userGroupRows) { 171 PermissionOwner permOwner = userGroup.Members.Single<PermissionOwner>( 172 p => p.PermissionOwnerId == permOwnerUserGroupRow.PermissionOwnerId); 172 PermissionOwner permOwner = null; 173 174 IEnumerable<PermissionOwner> permOwners = 175 from p in 176 userGroup.Members 177 where p.PermissionOwnerId == permOwnerUserGroupRow.PermissionOwnerId 178 select p; 179 180 if (permOwners.Count<PermissionOwner>() == 1) 181 permOwner = permOwners.First<PermissionOwner>(); 173 182 174 183 if (permOwner == null) { … … 234 243 235 244 return allUserGroups; 245 } 246 247 public ICollection<UserGroup> MemberOf(PermissionOwner permOwner) { 248 ICollection<UserGroup> userGroups = 249 new List<UserGroup>(); 250 251 if (permOwner != null) { 252 IEnumerable<dsHiveServer.PermissionOwner_UserGroupRow> userGroupRows = 253 from userGroup in 254 permOwnerUserGroupData.AsEnumerable<dsHiveServer.PermissionOwner_UserGroupRow>() 255 where userGroup.PermissionOwnerId == permOwner.PermissionOwnerId 256 select userGroup; 257 258 foreach (dsHiveServer.PermissionOwner_UserGroupRow userGroupRow in 259 userGroupRows) { 260 UserGroup userGroup = 261 GetUserGroupById(userGroupRow.UserGroupId); 262 userGroups.Add(userGroup); 263 } 264 } 265 266 return userGroups; 236 267 } 237 268 … … 249 280 permOwnerUserGroupData) { 250 281 if (permOwnerUserGroupRow.UserGroupId == group.PermissionOwnerId || 251 282 permOwnerUserGroupRow.PermissionOwnerId == group.PermissionOwnerId) { 252 283 deleted.Add(permOwnerUserGroupRow); 253 284 }
Note: See TracChangeset
for help on using the changeset viewer.