BlogEngine.Core.Providers.XmlRoleProvider.IsUserInRole C# (CSharp) Method

IsUserInRole() public method

Gets a value indicating whether the specified user is in the specified role for the configured applicationName.
public IsUserInRole ( string username, string roleName ) : bool
username string /// The user name to search for. ///
roleName string /// The role to search in. ///
return bool
        public override bool IsUserInRole(string username, string roleName)
        {
            ReadRoleDataStore();
            return
                this.roles[Blog.CurrentInstance.Id].Where(role => role.Name.Equals(roleName, StringComparison.OrdinalIgnoreCase)).SelectMany(
                    role => role.Users).Any(user => user.Equals(username, StringComparison.OrdinalIgnoreCase));
        }