fix(pages): add canEdit to page deletion permission check


Description: using canEdit allows plugins to override the delete permission check (e.g. groups owners in the group_tools plugin). I did not mark the function pages_can_delete_page in lib/pages as private since it could be used by other plugins.

Fixes #7007

Duplicate of pull request #7012 
These 3 conditions should be on separate lines for readability.

```php
if (!elgg_is_admin_logged_in()
        && elgg_get_logged_in_user_guid() != $entity->getOwnerGuid()
        && !pages_can_delete_page($entity)) {
    foreach ...
}
```