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 requests #7012 and #7645 

As per #7645, Steve Clay was suggesting using the ternary operator...Do you want me to go back to
```if ($container) {
	if ($container->canEdit()) {
		return true;
	} else {
		return false;
	}
} else {
	return false;
}```