public static Task <bool> HasAnyPermissionsAsync(this IAuthSession session, ICollection <string> permissions, IAuthRepositoryAsync authRepo, IRequest req, CancellationToken token = default) { if (session is IAuthSessionExtended extended) // always true for sessions inheriting AuthUserSession { return(extended.HasAnyPermissionsAsync(permissions, authRepo, req, token)); } #pragma warning disable 618 return(session.HasAnyPermissions(permissions, (IAuthRepository)authRepo, req).InTask()); #pragma warning restore 618 }
public virtual bool HasAnyPermissions(IRequest req, IAuthSession session, IAuthRepository authRepo) { return(session.HasAnyPermissions(RequiredPermissions, authRepo, req)); }