نظرات مطالب
سفارشی سازی ASP.NET Core Identity - قسمت پنجم - سیاست‌های دسترسی پویا
سلام؛ در متد CanUserAccess کلاس SecurityTrimmingService:
 public bool CanUserAccess(ClaimsPrincipal user, string area, string controller, string action)
        {
            var currentClaimValue = $"{area}:{controller}:{action}";
            var securedControllerActions = _mvcActionsDiscoveryService.GetAllSecuredControllerActionsWithPolicy(ConstantPolicies.DynamicPermission);
            if (!securedControllerActions.SelectMany(x => x.MvcActions).Any(x => x.ActionId == currentClaimValue))
            {
                throw new KeyNotFoundException($@"The `secured` area={area}/controller={controller}/action={action} with `ConstantPolicies.DynamicPermission` policy not found. Please check you have entered the area/controller/action names correctly and also it's decorated with the correct security policy.");
            }

            if (!user.Identity.IsAuthenticated)
            {
                return false;
            }

            if (user.IsInRole(ConstantRoles.Admin))
            {
                // Admin users have access to all of the pages.
                return true;
            }

            // Check for dynamic permissions
            // A user gets its permissions claims from the `ApplicationClaimsPrincipalFactory` class automatically and it includes the role claims too.
            return user.HasClaim(claim => claim.Type == ConstantPolicies.DynamicPermissionClaimType &&
                                          claim.Value == currentClaimValue);
        }
ابتدا بررسی میشه که کاربر دارای دسترسی مورد نظر می‌باشد و سپس چک میشه که کاربر احراز هویت شده و دارای دسترسی admin می‌باشد.
آیا کاربری که دارای دسترسی Admin می‌باشد نیازی به چک کردن  HasClaim دارد؟
مثلا اگر این متد به این صورت نوشته شود مشکلی پیش میاد؟
public bool CanUserAccess(ClaimsPrincipal user, string area, string controller, string action)
        {
            if (!user.Identity.IsAuthenticated)
            {
                return false;
            }

            if (user.IsInRole(ConstantRoles.Admin))
            {
                // Admin users have access to all of the pages.
                return true;
            }

            var currentClaimValue = $"{area}:{controller}:{action}";
            var securedControllerActions = _mvcActionsDiscoveryService.GetAllSecuredControllerActionsWithPolicy(ConstantPolicies.DynamicPermission);
            if (!securedControllerActions.SelectMany(x => x.MvcActions).Any(x => x.ActionId == currentClaimValue))
            {
                throw new KeyNotFoundException($@"The `secured` area={area}/controller={controller}/action={action} with `ConstantPolicies.DynamicPermission` policy not found. Please check you have entered the area/controller/action names correctly and also it's decorated with the correct security policy.");
            }

            // Check for dynamic permissions
            // A user gets its permissions claims from the `ApplicationClaimsPrincipalFactory` class automatically and it includes the role claims too.
            return user.HasClaim(claim => claim.Type == ConstantPolicies.DynamicPermissionClaimType &&
                                          claim.Value == currentClaimValue);
        }
اشتراک‌ها
امکانات فریم ورک جاوا اسکریپتی Essential JS
You can use Syncfusion controls to build mobile business dashboards
 

 

The first JavaScript control framework designed for line-of-business (LOB) applications
70+ unique controls including charts, grids, gantt, diagram and much more
 

امکانات فریم ورک جاوا اسکریپتی Essential JS
اشتراک‌ها
کتابخانه Polyglot-Language-Switcher-2
Polyglot Language Switcher is a JavaScript component which allows you to display a popup with the languages supported by your website.
This component has 3 implementations:
  1. jQuery Plugin
  2. AngularJS Directive
  3. ReactJS Component

Information about its usage and configuration can be found here  Demo

کتابخانه Polyglot-Language-Switcher-2
اشتراک‌ها
پشتیبانی از WebSockets در ASP.NET Core

This article explains how to get started with WebSockets in ASP.NET  Core. WebSocket is a protocol that enables two-way persistent communication channels over TCP connections. It is used for applications such as chat, stock tickers, games, anywhere you want real-time functionality in a web application.  

پشتیبانی از WebSockets  در ASP.NET Core
اشتراک‌ها
Visual Studio 17.8 منتشر شد

The latest update for Visual Studio 2022 is officially out. Offering a comprehensive suite of enhancements that span productivity, programming languages, and enterprise management, this general release is a monumental step forward. Developed with extensive user feedback, this version is fully compatible with .NET 8, which is also generally available as of today. 

Visual Studio 17.8 منتشر شد
اشتراک‌ها
بانک اطلاعاتی LokiJS

LokiJS is an in-memory database which prioritises performance over everything. LokiJS supports field indexing for faster document access and performs really well (near 500,000 ops/s) on those. Its built-in DynamicView class also enables to utilize indexes on data subsets for even faster performance.  

بانک اطلاعاتی LokiJS
اشتراک‌ها
کتاب رایگان Support Vector Machines Succinctly

Support Vector Machines (SVMs) are some of the most performant off-the-shelf, supervised machine-learning algorithms. In Support Vector Machines Succinctly, author Alexandre Kowalczyk guides readers through the building blocks of SVMs, from basic concepts to crucial problem-solving algorithms. He also includes numerous code examples and a lengthy bibliography for further study. By the end of the book, SVMs should be an important tool in the reader’s machine-learning toolbox.

Table of Contents
  1. Prerequisites
  2. The Perceptron
  3. The SVM Optimization Problem
  4. Solving the Optimization Problem
  5. Soft Margin SVM
  6. Kernels
  7. The SMO Algorithm
  8. Multi-Class SVMs
  9. Conclusion
  10. Appendix A: Datasets
  11. Appendix B: The SMO Algorithm
کتاب رایگان Support Vector Machines Succinctly