MvcWrench.Models.User.IsInRole C# (CSharp) Method

IsInRole() public method

public IsInRole ( string role ) : bool
role string
return bool
        public bool IsInRole(string role)
        {
            if (roles == null)
                roles = UserRepository.GetRolesForUser (ID);

            foreach (Role r in roles)
                if (string.Compare (role, r.Name, true) == 0)
                    return true;

            return false;
        }