Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/10 12:51:55 (14 years ago)
Author:
mholper
Message:

implemented RoleProvider.IsUserInRole (#1046)

File:
1 edited

Legend:

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

    r3962 r3963  
    100100    }
    101101
     102
     103    /// <summary>
     104    /// true if given username has exists in given Role, else false
     105    /// </summary>
     106    /// <param name="username"></param>
     107    /// <param name="roleName"></param>
     108    /// <returns>bool</returns>
    102109    public override bool IsUserInRole(string username, string roleName) {
    103       throw new NotImplementedException();
     110        bool returnValue = false;
     111        DataClassesDataContext context = DatabaseUtil.createDataClassesDataContext();
     112        if (username != null && roleName != null)
     113        {
     114            returnValue = (context.HeuristicLabUserRole.Count(ur => ur.HeuristicLabRole.RoleName == roleName && ur.HeuristicLabUser.UserName == username) > 0);
     115        }
     116        return returnValue;
    104117    }
    105118
Note: See TracChangeset for help on using the changeset viewer.