اهداف VS Code در سال 2018
نگاهی به Angular 2 و TypeScript
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); }
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); }
نحوهی کنترل هدر Referer
HTML5 added a whole bunch of useful new values for the rel
attribute, one of which is noreferrer
(yes, spelt correctly this time). When this attribute is added, the
browser is instructed not to set the header if the user follows the
link.
انتشار TypeScript 4.6
Here’s a quick list of what’s new in TypeScript 4.6!
Allowing Code in Constructors Before super()
Control Flow Analysis for Destructured Discriminated Unions
Improved Recursion Depth Checks
Indexed Access Inference Improvements
Control Flow Analysis for Dependent Parameters
--target es2022
Removed Unnecessary Arguments in react-jsx
JSDoc Name Suggestions
More Syntax and Binding Errors in JavaScript
TypeScript Trace Analyzer
Breaking Changes
TypeScript 4.6 Beta منتشر شد
Here’s a quick list of what’s new in TypeScript 4.6!
Allowing Code in Constructors Before super()
Improved Recursion Depth Checks
Indexed Access Inference Improvements
Control Flow Analysis for Dependent Parameters
More Syntax and Binding Errors in JavaScript
TypeScript Trace Analyzer
Breaking Changes
ایجاد Responsive Layered Slider
کتابخانه a2d3
A set of composable and extensible Angular 2 directives for building SVGs with D3 declaritively. This library provides functionality for basic charts out of the box, but it can be easily extended to support building declarative syntaxes for just about any SVG generated by D3. Demo