Make the permission check first.