AdvancedWf.Shared/ViewModels/DataTable/LINQExtensions.cs
/// <summary>
/// Helper to know if user in any of specific roles
/// </summary>
/// <param name="user">current logged user - Dependancy injection</param>
/// <param name="roles">List of string - roles names</param>
/// <returns></returns>
Helper to know if user in any of specific roles
Helper to know if user in any of specific roles
public static bool IsInAnyRole(this IPrincipal user, List<string> roles)
        {
            foreach (var item in roles)
                if (user.IsInRole(item)) return true;
            return false;
        }
public static bool IsInAnyRole ( this IPrincipal user , List < string > roles ) { foreach ( var item in roles ) if ( user . IsInRole ( item ) ) return true ; return false ; }
Helper to know if user in any of specific roles
Helper to know if user in any of specific roles
None
IPrincipal
this
roles
List<string>
List of string - roles names
List of string - roles names
user
current logged user - Dependancy injection
current logged user - Dependancy injection