Add permission check and data filtering for viewsite