Skip to content

Commit 7157efb

Browse files
committed
Revert "Updated the XSLT template to only perform resource claim relocation if the Claim element has a 'relocate' attribute set to true."
This reverts commit b1eef53.
1 parent 43f7461 commit 7157efb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

SecurityMetadata/Xslt/Security-Metadata-SQL-Generator.xslt

+2-6
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,17 @@ END
108108

109109
SET @claimId = SCOPE_IDENTITY()
110110
END
111-
<xsl:if test="@relocate = 'true'">
112111
ELSE
113112
BEGIN
114113
IF @parentResourceClaimId != @existingParentResourceClaimId OR (@parentResourceClaimId IS NULL AND @existingParentResourceClaimId IS NOT NULL) OR (@parentResourceClaimId IS NOT NULL AND @existingParentResourceClaimId IS NULL)
115114
BEGIN
116-
PRINT 'Relocating claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') under new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')'
115+
PRINT 'Repointing claim ''' + @claimName + ''' (ResourceClaimId=' + CONVERT(nvarchar, @claimId) + ') to new parent (ResourceClaimId=' + CONVERT(nvarchar, @parentResourceClaimId) + ')'
117116

118117
UPDATE dbo.ResourceClaims
119118
SET ParentResourceClaimId = @parentResourceClaimId
120119
WHERE ResourceClaimId = @claimId
121120
END
122121
END
123-
</xsl:if>
124122
<xsl:apply-templates select="DefaultAuthorization" mode="SqlServer" />
125123
<xsl:apply-templates select="ClaimSets" mode="SqlServer" />
126124
<xsl:apply-templates select="Claims" mode="SqlServer" />
@@ -316,16 +314,14 @@ END $$;
316314
VALUES ('<xsl:value-of select="tokenize(@name, '/')[last()]" />', '<xsl:value-of select="@name" />', parent_resource_claim_id)
317315
RETURNING ResourceClaimId
318316
INTO claim_id;
319-
<xsl:if test="@relocate = 'true'">
320317
ELSE
321318
IF parent_resource_claim_id != existing_parent_resource_claim_id OR (parent_resource_claim_id IS NULL AND existing_parent_resource_claim_id IS NOT NULL) OR (parent_resource_claim_id IS NOT NULL AND existing_parent_resource_claim_id IS NULL) THEN
322-
RAISE NOTICE USING MESSAGE = 'Relocating claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') under new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')';
319+
RAISE NOTICE USING MESSAGE = 'Repointing claim ''' || claim_name || ''' (ResourceClaimId=' || claim_id || ') to new parent (from ResourceClaimId=' || COALESCE(existing_parent_resource_claim_id, 0) || ' to ResourceClaimId=' || COALESCE(parent_resource_claim_id, 0) || ')';
323320

324321
UPDATE dbo.ResourceClaims
325322
SET ParentResourceClaimId = parent_resource_claim_id
326323
WHERE ResourceClaimId = claim_id;
327324
END IF;
328-
</xsl:if>
329325
END IF;
330326
<xsl:apply-templates select="DefaultAuthorization" mode="PostgreSql" />
331327
<xsl:apply-templates select="ClaimSets" mode="PostgreSql" />

0 commit comments

Comments
 (0)