Cats.Web.Hub.RoleProvider.IsUserInRole C# (CSharp) Method

IsUserInRole() public method

public IsUserInRole ( string username, string roleName ) : bool
username string
roleName string
return bool
        public override bool IsUserInRole(string username, string roleName)
        {
            var userRoldeService = (IUserRoleService)DependencyResolver.Current.GetService(typeof(IUserRoleService));
            var count =
                userRoldeService.Get(t => t.UserProfile.UserName == username && t.Role.Name == roleName, null,
                                     "UserProfile,Role").Count();

            return (count > 0);
        }