Last active
April 22, 2020 14:02
-
-
Save rich-biker/406743381cfc987a3f9b721a68284540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Script: Reverse Access | |
A jArchi script for use on an Archi repository | |
Purpose: Reverse all selected access relationships Access Type direction (e.g. read -> write / write -> read) | |
Useful as the default access type for an access relationship is 'write'. This allows several to be reversed. | |
Author: Richard Heward - Tame Blue Lion | |
Date: 28-Feb-2019 | |
*/ | |
console.clear(); | |
console.log("Reversing Access Relationships"); | |
var revCount = 0; | |
var objList = $(selection).filter('access-relationship'); | |
objList.each(function (accessRel) { | |
if (accessRel.concept.accessType === 'read') { | |
revCount++; | |
accessRel.concept.accessType = 'write'; | |
} | |
if (accessRel.concept.accessType === 'write') { | |
revCount++; | |
accessRel.concept.accessType = 'read'; | |
} | |
}); | |
console.log("Num relationships reversed: ", revCount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment