function addPermissionRow(permType, tableId, userId, userName)
{
	var tbl = document.getElementById(tableId);
	var lastRow = tbl.rows.length - 1;
	
	var row = tbl.insertRow(lastRow);
	
	var cellLeft = row.insertCell(0);
	var textNode = document.createTextNode(userName);
	cellLeft.appendChild(textNode);
	  
	nextCell = 1;
	  
	for (var i=1; i<128; i = i * 2)
	{
		var cellLeft = row.insertCell(nextCell);
		var el = document.createElement('input');
		el.type = 'checkbox';
		el.name = 'perms['+permType+'][' + userId + '][]';
		el.value = i;
		cellLeft.align = 'center';
		cellLeft.appendChild(el);
		
		nextCell++;
	}
}