Error: Permission denied to access property “document”

Accessing and then modifying webpages in iframes of other websites is known as Cross-site scripting or XSS and it is a technique used by malicious hackers to prey on unsuspecting victims. A policy by the name of “Same-Origin Policy” is implemented by browser makers to prevent such behaviour and arbitrary execution of JS code. This …

Read more

Font Awesome icons not showing in Chrome, a MaxCDN related Cross-Origin Resource Sharing policy issue

Here is the working method to allow access from all domains for webfonts: # Allow access from all domains for webfonts. # Alternatively you could only whitelist your # subdomains like “subdomain.example.com”. <IfModule mod_headers.c> <FilesMatch “\.(ttf|ttc|otf|eot|woff|font.css|css)$”> Header set Access-Control-Allow-Origin “*” </FilesMatch> </IfModule>

public struct in framework init is inaccessible due to ‘internal’ protection level in compiler

Lesson learned: all public struct need a public init That’s not quite exact. The documentation states: Default Memberwise Initializers for Structure Types The default memberwise initializer for a structure type is considered private if any of the structure’s stored properties are private. Likewise, if any of the structure’s stored properties are file private, the initializer …

Read more

How to implement Permission Based Access Control with Asp.Net Core

Based on the comments, here an example on how to use the policy based authorization: public class PermissionRequirement : IAuthorizationRequirement { public PermissionRequirement(PermissionEnum permission) { Permission = permission; } public PermissionEnum Permission { get; } } public class PermissionHandler : AuthorizationHandler<PermissionRequirement> { private readonly IUserPermissionsRepository permissionRepository; public PermissionHandler(IUserPermissionsRepository permissionRepository) { if(permissionRepository == null) throw new …

Read more