Do a proper check for permissions.