Commit df1ed9b0 authored by Paul Zuehlcke's avatar Paul Zuehlcke
Browse files

Bug 1574483 - Updated Policies.jsm to use PermissionManager principal methods. r=mkaply

Differential Revision: https://phabricator.services.mozilla.com/D42523

--HG--
extra : moz-landing-system : lando
parent bd9e6471
......@@ -1436,7 +1436,7 @@ function setDefaultPermission(policyName, policyParam) {
/**
* addAllowDenyPermissions
*
* Helper function to call the permissions manager (Services.perms.add)
* Helper function to call the permissions manager (Services.perms.addFromPrincipal)
* for two arrays of URLs.
*
* @param {string} permissionName
......@@ -1452,8 +1452,8 @@ function addAllowDenyPermissions(permissionName, allowList, blockList) {
for (let origin of allowList) {
try {
Services.perms.add(
Services.io.newURI(origin.href),
Services.perms.addFromPrincipal(
Services.scriptSecurityManager.createContentPrincipalFromOrigin(origin),
permissionName,
Ci.nsIPermissionManager.ALLOW_ACTION,
Ci.nsIPermissionManager.EXPIRE_POLICY
......@@ -1465,8 +1465,8 @@ function addAllowDenyPermissions(permissionName, allowList, blockList) {
}
for (let origin of blockList) {
Services.perms.add(
Services.io.newURI(origin.href),
Services.perms.addFromPrincipal(
Services.scriptSecurityManager.createContentPrincipalFromOrigin(origin),
permissionName,
Ci.nsIPermissionManager.DENY_ACTION,
Ci.nsIPermissionManager.EXPIRE_POLICY
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment