//  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)
}

sitemap