source: branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabRoleProvider.cs @ 3951

Last change on this file since 3951 was 3951, checked in by bfarka, 9 years ago

changed persistence for roles and implemented first Method in RoleProvider --> FinAllUsers (#1046)

File size: 1.8 KB
Line 
1using System;
2using System.Web.Security;
3using System.Linq;
4using Persistence;
5
6namespace Service.Provider {
7  class HeuristicLabRoleProvider : RoleProvider {
8    public override void AddUsersToRoles(string[] usernames, string[] roleNames) {
9      throw new NotImplementedException();
10    }
11
12    public override string ApplicationName {
13      get {
14        throw new NotImplementedException();
15      }
16      set {
17        throw new NotImplementedException();
18      }
19    }
20
21    public override void CreateRole(string roleName) {
22      throw new NotImplementedException();
23    }
24
25    public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) {
26      throw new NotImplementedException();
27    }
28
29    public override string[] FindUsersInRole(string roleName, string usernameToMatch) {
30      throw new NotImplementedException();
31    }
32
33    public override string[] GetAllRoles() {
34      throw new NotImplementedException();
35    }
36
37    public override string[] GetRolesForUser(string username) {
38      throw new NotImplementedException();
39    }
40
41    public override string[] GetUsersInRole(string roleName) {
42      throw new NotImplementedException();
43    }
44
45    public override bool IsUserInRole(string username, string roleName) {
46      throw new NotImplementedException();
47    }
48
49    public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames) {
50      throw new NotImplementedException();
51    }
52
53    public override bool RoleExists(string roleName) {
54
55      Persistence.DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext();
56      bool returnValue = (DatabaseUtil.createDataClassesDataContext().HeuristicLabRole.Count(r => r.RoleName == roleName) == 1);
57      db.Connection.Close();
58      return returnValue;
59
60    }
61  }
62}
Note: See TracBrowser for help on using the repository browser.