For my Page content type, I want nodes created by administrators to be in my Simple XML Sitemap, but I want to exclude nodes created by non-admin users.
Administrators have permission to administer Simple XML Sitemap, and regular users do not.
On the Page content type settings, I have checked the box to index nodes of type Page by default. (You must enable indexing by default in order to get the Simple XML Sitemap settings widget on the node edit screen.)
I tried to change the settings in
hook_form_alter(), but it doesn’t work because non-admin users do not ever see the Simple Sitemap widget (it is not attached to the form if the user does not have admin permission for Simple XML Sitemap).
So I’m stuck:
- I have to enable indexing by default on the node edit page to get the widget to appear.
- Non-admin users do not have access to the widget, so I cannot change the value for non-admin users with
hook_form_alter()(I have to accept the default).
How do I resolve this paradox?