Scalr\Upgrade\Updates\Update20150505143635::createAclPermissionRule PHP Method

createAclPermissionRule() protected method

Create allow permission if base acl role is forbidden and permFlag is allowed, and deny permission if base acl role is allowed and permFlag is denied. If permFlag is null, do nothing
protected createAclPermissionRule ( string $accountRoleId, string $permFlag, integer $resource, string $permName, boolean $isDenyRole )
$accountRoleId string The identifier of the ACL role on account
$permFlag string The permission value
$resource integer The identifier of the ACL resource
$permName string The identifier of the ACL permission
$isDenyRole boolean Whether the account level role derived from full access role
    protected function createAclPermissionRule($accountRoleId, $permFlag, $resource, $permName, $isDenyRole)
    {
        if ($permFlag === '1' && $isDenyRole || $permFlag === '0' && !$isDenyRole) {
            $this->db->Execute("\n                INSERT IGNORE acl_account_role_resource_permissions (`account_role_id`, `resource_id`, `perm_id`, `granted`)\n                VALUES (?, ?, ?, ?)\n            ", [$accountRoleId, $resource, $permName, $permFlag]);
        }
    }