Set Access Inherited for all Items

This simple script allows you to set the access rights to inherited for all items below the current folder. This may be useful if you wish to reset access rights for the items in an imported project. This script sets access rights at the item (Project, Folder, Module) level. It does not open modules and set access on objects.

//  Set access inherited on all items below current folder

/*
	This simple script allows you to set the access rights to inherited
	for all items below the current folder.

	Tony Goodman.
*/

/********************************************
	setAccessInherited
********************************************/
void setAccessInherited(Item itm)
{
	string res = ""
	Item   i

	if (null itm) return
	if (isDeleted itm) return

	res = inherited(itm)

	if (res != "")
	{
		print("ERROR: " fullName(itm) ": " res "\n")
	}
	else
	{
		print("Access set: " fullName(itm) "\n")
	}

	if (type(itm) == "Folder" || type(itm) == "Project")
	{
		for i in folder(itm) do
		{
			setAccessInherited(i)
		}
	}
}

/********************************************
	MAIN
********************************************/
Item itm

if (!confirm("Please confirm that you wish to set access rights to inherited for all items below\n" fullName(current Folder) "."))
{
	halt
}

for itm in current Folder do
{
	setAccessInherited(itm)
}