Changed permission check to table