Adapted to new permission model.